diff --git a/TablePro/TableProApp.swift b/TablePro/TableProApp.swift index 72fa4a77..2519cc34 100644 --- a/TablePro/TableProApp.swift +++ b/TablePro/TableProApp.swift @@ -393,6 +393,18 @@ struct AppMenuCommands: Commands { } .optionalKeyboardShortcut(shortcut(for: .closeResultTab)) .disabled(!appState.isConnected) + + Divider() + + Button("Zoom In") { + ThemeEngine.shared.adjustEditorFontSize(by: 1) + } + .keyboardShortcut("=", modifiers: .command) + + Button("Zoom Out") { + ThemeEngine.shared.adjustEditorFontSize(by: -1) + } + .keyboardShortcut("-", modifiers: .command) } // Tab navigation shortcuts — native macOS window tabs diff --git a/TablePro/Theme/ThemeEngine.swift b/TablePro/Theme/ThemeEngine.swift index 82b0c3a1..63dd555f 100644 --- a/TablePro/Theme/ThemeEngine.swift +++ b/TablePro/Theme/ThemeEngine.swift @@ -199,6 +199,18 @@ internal final class ThemeEngine { availableThemes = ThemeStorage.loadAllThemes() } + // MARK: - Editor Font Size Zoom + + func adjustEditorFontSize(by delta: Int) { + var theme = activeTheme + let newSize = max(9, min(24, theme.fonts.editorFontSize + delta)) + guard newSize != theme.fonts.editorFontSize else { return } + theme.fonts.editorFontSize = newSize + activeTheme = theme + editorFonts = EditorFontCache(from: theme.fonts) + notifyThemeDidChange() + } + // MARK: - Font Cache Reload (accessibility) func reloadFontCaches() { diff --git a/docs/features/keyboard-shortcuts.mdx b/docs/features/keyboard-shortcuts.mdx index 90a17b3a..7fa4f42d 100644 --- a/docs/features/keyboard-shortcuts.mdx +++ b/docs/features/keyboard-shortcuts.mdx @@ -190,6 +190,13 @@ TablePro is keyboard-driven. Most actions have shortcuts, and most menu shortcut | Next Result | `Cmd+Opt+]` | | Close Result Tab | `Cmd+Shift+W` | +### Editor Zoom + +| Action | Shortcut | +|--------|----------| +| Zoom In | `Cmd+=` | +| Zoom Out | `Cmd+-` | + ### AI | Action | Shortcut | Description |