From 37e78f0c037e3b15835417c4e5b1441bb3151a10 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Tue, 11 Apr 2023 17:04:27 -0700 Subject: [PATCH] allow Ctrl+F to focus the search bar on artists, genres, playlists pages --- ui/browsing/artistsgenrespage.go | 6 ++++++ ui/browsing/playlistspage.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ui/browsing/artistsgenrespage.go b/ui/browsing/artistsgenrespage.go index 40add25..4aa8b09 100644 --- a/ui/browsing/artistsgenrespage.go +++ b/ui/browsing/artistsgenrespage.go @@ -106,6 +106,12 @@ func (a *ArtistsGenresPage) onSearched(query string) { a.list.Refresh() } +var _ Searchable = (*ArtistsGenresPage)(nil) + +func (a *ArtistsGenresPage) SearchWidget() fyne.Focusable { + return a.searcher.Entry +} + func (a *ArtistsGenresPage) Route() controller.Route { if a.isGenresPage { return controller.GenresRoute() diff --git a/ui/browsing/playlistspage.go b/ui/browsing/playlistspage.go index 9128ca1..0a7b189 100644 --- a/ui/browsing/playlistspage.go +++ b/ui/browsing/playlistspage.go @@ -86,6 +86,12 @@ func (a *PlaylistsPage) onSearched(query string) { a.list.Refresh() } +var _ Searchable = (*PlaylistsPage)(nil) + +func (a *PlaylistsPage) SearchWidget() fyne.Focusable { + return a.searcher.Entry +} + func (a *PlaylistsPage) Route() controller.Route { return controller.PlaylistsRoute() }