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
+16
View File
@@ -89,6 +89,18 @@ func (t *TracksPage) Route() controller.Route {
return controller.TracksRoute()
}
var _ CanSelectAll = (*TracksPage)(nil)
func (t *TracksPage) SelectAll() {
// deliberate no-op since we don't want to give the impression
// that you can select all tracks from the server, since only
// some of them are actually loaded into the model
}
func (t *TracksPage) UnselectAll() {
t.currentTracklist().UnselectAll()
}
func (t *TracksPage) Reload() {
t.tracklist.Clear()
iter := t.mp.IterateTracks("")
@@ -161,6 +173,10 @@ func (t *TracksPage) doSearch(query string) {
t.Refresh()
}
func (t *TracksPage) currentTracklist() *widgets.Tracklist {
return t.container.Objects[0].(*fyne.Container).Objects[0].(*widgets.Tracklist)
}
func (t *TracksPage) CreateRenderer() fyne.WidgetRenderer {
return widget.NewSimpleRenderer(t.container)
}