diff options
| author | Paul Buetow <paul@buetow.org> | 2025-07-20 09:32:14 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-07-20 09:32:14 +0300 |
| commit | ff01e800a6633b74050c6f75e5798736c93743b4 (patch) | |
| tree | 0ca488526adfc965572893bfb1792ae7bb387d3a /internal/gui | |
| parent | 4e1d5a1937f2dc23df58e4d21a8e0ae77ec5e4df (diff) | |
feat: change help hotkey to ? and add vim-style navigation
- Changed help screen hotkey from 'h' to '?'
- Added vim-style navigation keys: h/х for previous, l/л for next
- Updated help dialog to reflect new key bindings
- Updated button tooltips with new shortcuts
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/gui')
| -rw-r--r-- | internal/gui/app.go | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/internal/gui/app.go b/internal/gui/app.go index 3e256b8..a6f4eec 100644 --- a/internal/gui/app.go +++ b/internal/gui/app.go @@ -394,7 +394,7 @@ func (a *Application) setupUI() { // Set tooltips for export and help buttons exportButton.SetToolTip("Export to Anki (x)") - helpButton.SetToolTip("Show hotkeys (h)") + helpButton.SetToolTip("Show hotkeys (?)") a.window.SetOnClosed(func() { // Stop file check ticker @@ -1089,8 +1089,8 @@ func (a *Application) onShowHotkeys() { --- ## Navigation -**←** Previous word -**→** Next word +**← / h/х** Previous word (vim-style) +**→ / l/л** Next word (vim-style) **Tab** Navigate fields **Esc** Unfocus field @@ -1115,7 +1115,7 @@ func (a *Application) onShowHotkeys() { **x/ж** Export to Anki ## Help -**h/х** Show hotkeys +**?** Show hotkeys **c/ц** Close dialog **q/ч** Quit application @@ -1254,8 +1254,8 @@ func (a *Application) clearUI() { func (a *Application) setupTooltips() { // Navigation button tooltips a.submitButton.SetToolTip("Generate word (g)") - a.prevWordBtn.SetToolTip("Previous word (←)") - a.nextWordBtn.SetToolTip("Next word (→)") + a.prevWordBtn.SetToolTip("Previous word (← / h/х)") + a.nextWordBtn.SetToolTip("Next word (→ / l/л)") // Action button tooltips a.keepButton.SetToolTip("Keep card and new word (n)") @@ -1699,8 +1699,16 @@ func (a *Application) setupKeyboardShortcuts() { } case 'ж', 'Ж': // ж = x a.onExportToAnki() - case 'х', 'Х': // х = h + case '?': a.onShowHotkeys() + case 'h', 'H', 'х', 'Х': // h/х = previous (vim-style) + if !a.prevWordBtn.Disabled() { + a.onPrevWord() + } + case 'l', 'L', 'л', 'Л': // l/л = next (vim-style) + if !a.nextWordBtn.Disabled() { + a.onNextWord() + } case 'ч', 'Ч': // ч = q a.window.Close() } @@ -1834,8 +1842,17 @@ func (a *Application) handleShortcutKey(key fyne.KeyName) { case fyne.KeyX: // Export to APKG a.onExportToAnki() - case fyne.KeyH: // Show hotkeys - a.onShowHotkeys() + case fyne.KeyH: // Previous word (vim-style) + if a.prevWordBtn.Disabled() { + return + } + a.onPrevWord() + + case fyne.KeyL: // Next word (vim-style) + if a.nextWordBtn.Disabled() { + return + } + a.onNextWord() case fyne.KeyQ: // Quit application a.window.Close() } |
