more work on artist list page

This commit is contained in:
Drew Weymouth
2023-01-14 16:52:13 -08:00
parent ab72d0dbdd
commit 760bab1ee3
7 changed files with 117 additions and 63 deletions
+11 -3
View File
@@ -2,6 +2,7 @@ package ui
import (
"supersonic/backend"
"supersonic/res"
"supersonic/ui/browsing"
"supersonic/ui/widgets"
@@ -32,9 +33,6 @@ func NewMainWindow(fyneApp fyne.App, appName string, app *backend.App) MainWindo
}
m.Router = browsing.NewRouter(app, m.BrowsingPane)
m.BrowsingPane.OnGoHome = func() {
m.Router.OpenRoute(HomePage)
}
m.BottomPanel = NewBottomPanel(app.Player, m.Router.OpenRoute)
m.BottomPanel.SetPlaybackManager(app.PlaybackManager)
m.BottomPanel.ImageManager = app.ImageManager
@@ -51,6 +49,7 @@ func NewMainWindow(fyneApp fyne.App, appName string, app *backend.App) MainWindo
app.ServerManager.OnServerConnected(func() {
m.Router.OpenRoute(HomePage)
})
m.addNavigationButtons()
return m
}
@@ -64,6 +63,15 @@ func (m *MainWindow) PromptForFirstServer(cb func(string, string, string, string
pop.Show()
}
func (m *MainWindow) addNavigationButtons() {
m.BrowsingPane.AddNavigationButton(res.ResDiscInvertPng, func() {
m.Router.OpenRoute(browsing.AlbumsRoute(backend.AlbumSortRecentlyAdded))
})
m.BrowsingPane.AddNavigationButton(res.ResPeopleInvertPng, func() {
m.Router.OpenRoute(browsing.ArtistsRoute())
})
}
func (m *MainWindow) Show() {
m.Window.Show()
}