ensure clicking anywhere outside tracklists can unselect all

This commit is contained in:
Drew Weymouth
2024-12-15 15:52:21 -08:00
parent 46153f5fe3
commit 1d342bf413
9 changed files with 113 additions and 48 deletions
+22 -8
View File
@@ -41,14 +41,15 @@ type CurPageFunc func() Route
type Controller struct {
visualizationData
AppVersion string
App *backend.App
MainWindow fyne.Window
NavHandler NavigationHandler
CurPageFunc CurPageFunc
ReloadFunc func()
RefreshPageFunc func()
SelectAllPageFunc func()
AppVersion string
App *backend.App
MainWindow fyne.Window
NavHandler NavigationHandler
CurPageFunc CurPageFunc
ReloadFunc func()
RefreshPageFunc func()
SelectAllPageFunc func()
UnselectAllPageFunc func()
popUpQueueMutex sync.Mutex
popUpQueue *widget.PopUp
@@ -101,6 +102,19 @@ func (m *Controller) SelectAll() {
}
}
func (m *Controller) UnselectAll() {
m.popUpQueueMutex.Lock()
if m.popUpQueue != nil && m.popUpQueue.Visible() {
m.popUpQueueList.UnselectAll()
m.popUpQueueMutex.Unlock()
return
}
m.popUpQueueMutex.Unlock()
if m.SelectAllPageFunc != nil {
m.UnselectAllPageFunc()
}
}
func (m *Controller) NavigateTo(route Route) {
m.NavHandler(route)
}