getting the album name from titleLabel and adding ellipsis after 'Download' option

This commit is contained in:
natilou
2023-06-21 23:35:56 -03:00
parent d59ed11647
commit 6318ce33e4
4 changed files with 6 additions and 11 deletions
+3 -8
View File
@@ -201,14 +201,9 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader {
a.page.contr.DoAddTracksToPlaylistWorkflow( a.page.contr.DoAddTracksToPlaylistWorkflow(
sharedutil.TracksToIDs(a.page.tracks)) sharedutil.TracksToIDs(a.page.tracks))
}), }),
fyne.NewMenuItem("Download", func() { fyne.NewMenuItem("Download...", func() {
go func() { a.page.contr.ShowDownloadDialog(a.page.tracks, a.titleLabel.String())
album, err := a.page.mp.GetAlbum(a.albumID)
if err != nil {
log.Print("Error while getting the album: ", album)
}
a.page.contr.ShowDownloadDialog(a.page.tracks, album.Name)
}()
})) }))
pop = widget.NewPopUpMenu(menu, fyne.CurrentApp().Driver().CanvasForObject(a)) pop = widget.NewPopUpMenu(menu, fyne.CurrentApp().Driver().CanvasForObject(a))
} }
+1 -1
View File
@@ -261,7 +261,7 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader {
a.page.contr.DoAddTracksToPlaylistWorkflow( a.page.contr.DoAddTracksToPlaylistWorkflow(
sharedutil.TracksToIDs(a.page.tracks)) sharedutil.TracksToIDs(a.page.tracks))
}), }),
fyne.NewMenuItem("Download", func() { fyne.NewMenuItem("Download...", func() {
a.page.contr.ShowDownloadDialog(a.page.tracks, a.playlistInfo.Name) a.page.contr.ShowDownloadDialog(a.page.tracks, a.playlistInfo.Name)
})) }))
pop = widget.NewPopUpMenu(menu, fyne.CurrentApp().Driver().CanvasForObject(a)) pop = widget.NewPopUpMenu(menu, fyne.CurrentApp().Driver().CanvasForObject(a))
+1 -1
View File
@@ -175,7 +175,7 @@ func (g *GridViewItem) showContextMenu(pos fyne.Position) {
fyne.NewMenuItem("Shuffle", func() { g.onPlay(true) }), fyne.NewMenuItem("Shuffle", func() { g.onPlay(true) }),
fyne.NewMenuItem("Add to queue", g.onAddToQueue), fyne.NewMenuItem("Add to queue", g.onAddToQueue),
fyne.NewMenuItem("Add to playlist...", g.onAddToPlaylist), fyne.NewMenuItem("Add to playlist...", g.onAddToPlaylist),
fyne.NewMenuItem("Download", g.onDownload)), fyne.NewMenuItem("Download...", g.onDownload)),
fyne.CurrentApp().Driver().CanvasForObject(g)) fyne.CurrentApp().Driver().CanvasForObject(g))
} }
g.menu.ShowAtPosition(pos) g.menu.ShowAtPosition(pos)
+1 -1
View File
@@ -510,7 +510,7 @@ func (t *Tracklist) onShowContextMenu(e *fyne.PointEvent, trackIdx int) {
} }
})) }))
t.ctxMenu.Items = append(t.ctxMenu.Items, t.ctxMenu.Items = append(t.ctxMenu.Items,
fyne.NewMenuItem("Download", func() { fyne.NewMenuItem("Download...", func() {
t.onDownload(t.selectedTracks(), "Selected tracks") t.onDownload(t.selectedTracks(), "Selected tracks")
})) }))
t.ctxMenu.Items = append(t.ctxMenu.Items, fyne.NewMenuItemSeparator()) t.ctxMenu.Items = append(t.ctxMenu.Items, fyne.NewMenuItemSeparator())