Ctrl+A selects all on pop up queue if visible
This commit is contained in:
@@ -48,6 +48,7 @@ type Controller struct {
|
|||||||
CurPageFunc CurPageFunc
|
CurPageFunc CurPageFunc
|
||||||
ReloadFunc func()
|
ReloadFunc func()
|
||||||
RefreshPageFunc func()
|
RefreshPageFunc func()
|
||||||
|
SelectAllPageFunc func()
|
||||||
|
|
||||||
popUpQueueMutex sync.Mutex
|
popUpQueueMutex sync.Mutex
|
||||||
popUpQueue *widget.PopUp
|
popUpQueue *widget.PopUp
|
||||||
@@ -87,6 +88,19 @@ func New(app *backend.App, appVersion string, mainWindow fyne.Window) *Controlle
|
|||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Controller) SelectAll() {
|
||||||
|
m.popUpQueueMutex.Lock()
|
||||||
|
if m.popUpQueue != nil && m.popUpQueue.Visible() {
|
||||||
|
m.popUpQueueList.SelectAll()
|
||||||
|
m.popUpQueueMutex.Unlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
m.popUpQueueMutex.Unlock()
|
||||||
|
if m.SelectAllPageFunc != nil {
|
||||||
|
m.SelectAllPageFunc()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (m *Controller) NavigateTo(route Route) {
|
func (m *Controller) NavigateTo(route Route) {
|
||||||
m.NavHandler(route)
|
m.NavHandler(route)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -67,6 +67,7 @@ func NewMainWindow(fyneApp fyne.App, appName, displayAppName, appVersion string,
|
|||||||
m.Controller.ReloadFunc = m.BrowsingPane.Reload
|
m.Controller.ReloadFunc = m.BrowsingPane.Reload
|
||||||
m.Controller.CurPageFunc = m.BrowsingPane.CurrentPage
|
m.Controller.CurPageFunc = m.BrowsingPane.CurrentPage
|
||||||
m.Controller.RefreshPageFunc = m.BrowsingPane.RefreshPage
|
m.Controller.RefreshPageFunc = m.BrowsingPane.RefreshPage
|
||||||
|
m.Controller.SelectAllPageFunc = m.BrowsingPane.SelectAll
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" {
|
if runtime.GOOS == "darwin" {
|
||||||
// Fyne will extract out an "About" menu item and
|
// Fyne will extract out an "About" menu item and
|
||||||
@@ -353,7 +354,7 @@ func (m *MainWindow) addShortcuts() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
m.Canvas().AddShortcut(&fyne.ShortcutSelectAll{}, func(_ fyne.Shortcut) {
|
m.Canvas().AddShortcut(&fyne.ShortcutSelectAll{}, func(_ fyne.Shortcut) {
|
||||||
m.BrowsingPane.SelectAll()
|
m.Controller.SelectAll()
|
||||||
})
|
})
|
||||||
m.Canvas().AddShortcut(&shortcuts.ShortcutCloseWindow, func(_ fyne.Shortcut) {
|
m.Canvas().AddShortcut(&shortcuts.ShortcutCloseWindow, func(_ fyne.Shortcut) {
|
||||||
if m.App.Config.Application.CloseToSystemTray && m.HaveSystemTray() {
|
if m.App.Config.Application.CloseToSystemTray && m.HaveSystemTray() {
|
||||||
|
|||||||
Reference in New Issue
Block a user