reuse context menu across both types of tracklist

This commit is contained in:
Drew Weymouth
2025-03-26 17:06:56 -07:00
parent 5c88180d69
commit 9ddb5e6e69
3 changed files with 67 additions and 106 deletions
+12
View File
@@ -166,6 +166,18 @@ func NewNowPlayingPage(
a.relatedList.OnPlaySelectionNext = func(items []mediaprovider.MediaItem) {
a.pm.LoadItems(items, backend.InsertNext, false)
}
a.relatedList.OnPlaySongRadio = func(track *mediaprovider.Track) {
go func() {
if err := a.pm.PlaySimilarSongs(track.ID); err != nil {
fyne.Do(func() {
a.contr.ToastProvider.ShowErrorToast(lang.L("Unable to play song radio"))
})
}
}()
}
a.relatedList.OnShowTrackInfo = func(track *mediaprovider.Track) {
a.contr.ShowTrackInfoDialog(track)
}
a.lyricsViewer = widgets.NewLyricsViewer()
a.statusLabel = widget.NewLabel(lang.L("Stopped"))