Fix #136: add context menu to album and playlist grid views

This commit is contained in:
Drew Weymouth
2023-05-02 17:50:35 -07:00
parent 118b19aa13
commit 76657b5c1c
10 changed files with 122 additions and 97 deletions
+1 -10
View File
@@ -124,10 +124,6 @@ func (a *ArtistPage) OnSongChange(track *subsonic.Child, lastScrobbledIfAny *sub
}
}
func (a *ArtistPage) onPlayAlbum(albumID string) {
a.pm.PlayAlbum(albumID, 0)
}
func (a *ArtistPage) playAllTracks() {
if a.artistInfo != nil { // page loaded
for i, album := range a.artistInfo.Album {
@@ -141,10 +137,6 @@ func (a *ArtistPage) playArtistRadio() {
go a.pm.PlaySimilarSongs(a.artistID)
}
func (a *ArtistPage) onShowAlbumPage(albumID string) {
a.contr.NavigateTo(controller.AlbumRoute(albumID))
}
// should be called asynchronously
func (a *ArtistPage) load() {
artist, err := a.sm.Server.GetArtist(a.artistID)
@@ -182,8 +174,7 @@ func (a *ArtistPage) showAlbumGrid() {
}
})
a.albumGrid = widgets.NewFixedGridView(model, a.im)
a.albumGrid.OnPlay = a.onPlayAlbum
a.albumGrid.OnShowItemPage = a.onShowAlbumPage
a.contr.ConnectAlbumGridActions(a.albumGrid)
}
a.container.Objects[0].(*fyne.Container).Objects[0] = a.albumGrid
a.container.Objects[0].Refresh()