reset focus on page change

This commit is contained in:
Drew Weymouth
2023-01-21 10:00:06 -08:00
parent 373925dc53
commit 51fc4b284f
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -88,9 +88,12 @@ func (m *MainWindow) addNavigationButtons() {
func (m *MainWindow) addShortcuts() {
m.Canvas().AddShortcut(&ShortcutBack, func(_ fyne.Shortcut) {
m.BrowsingPane.GoBack()
// TODO: reset focus only if something inside the page had focus
m.Canvas().Focus(nil)
})
m.Canvas().AddShortcut(&ShortcutForward, func(_ fyne.Shortcut) {
m.BrowsingPane.GoForward()
m.Canvas().Focus(nil)
})
m.Canvas().AddShortcut(&ShortcutSearch, func(_ fyne.Shortcut) {
if s := m.BrowsingPane.GetSearchBarIfAny(); s != nil {