Add icons to menu items
This commit is contained in:
+5
-5
@@ -50,11 +50,6 @@ var ResPlaylistSvg = &fyne.StaticResource{
|
||||
StaticContent: []byte(
|
||||
"<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\n<svg fill=\"#000000\" width=\"800px\" height=\"800px\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16 17a3 3 0 0 1-3 3h-2a3 3 0 0 1 0-6h2a3 3 0 0 1 1 .17V1l6-1v4l-4 .67V17zM0 3h12v2H0V3zm0 4h12v2H0V7zm0 4h12v2H0v-2zm0 4h6v2H0v-2z\"/></svg>"),
|
||||
}
|
||||
var ResShuffleInvertSvg = &fyne.StaticResource{
|
||||
StaticName: "shuffle-invert.svg",
|
||||
StaticContent: []byte(
|
||||
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->\n<svg fill=\"#ffffff\" version=\"1.1\" id=\"Capa_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"800px\" height=\"800px\" viewBox=\"0 0 460.303 460.303\" xml:space=\"preserve\">\n\r<g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"/>\n\r<g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n\r<g id=\"SVGRepo_iconCarrier\"> <g> <g> <path d=\"M175.008,244.596c-10.181,15.488-20.962,30.534-33.825,44.067c-30.305,31.879-69.853,40.344-112.522,38.176 c-38.309-1.95-38.121,57.473,0,59.412c80.166,4.072,136.831-30.564,181.944-89.529c-7.429-9.684-14.294-19.438-20.576-28.838 C184.859,260.16,179.857,252.264,175.008,244.596z\"/> <path d=\"M252.401,197.317c4.118,6.475,8.186,12.842,12.289,19.083c7.521-10.384,15.544-20.408,24.572-29.729 c22.79-23.524,48.754-33.19,77.262-35.925c-1.809,2.179-3.565,4.398-5.388,6.566c-10.415,12.377-12.172,29.833,0,42.01 c10.709,10.712,31.574,12.403,42.01,0c16.071-19.093,31.423-38.791,47.494-57.884c10.466-10.519,14.473-28.013,1.519-42.046 l-53.466-57.927c-26.035-28.203-67.943,13.909-42.011,42.01l6.941,7.519c-29.162,2.087-57.243,9.506-83.172,26.359 c-19.372,12.594-35.662,28.779-50.195,46.512c2.919,4.093,5.834,8.252,8.703,12.594 C243.546,183.401,248.045,190.478,252.401,197.317z\"/> <path d=\"M403.151,260.978c-5.032-5.972-12.477-8.678-20.048-8.678c-8.135,0-16.417,3.133-21.962,8.678 c-12.172,12.182-10.415,29.635,0,42.01c1.823,2.169,3.58,4.393,5.388,6.571c-28.508-2.731-54.477-12.405-77.262-35.927 c-12.964-13.381-23.901-28.178-34.17-43.478c-9.952-14.825-19.266-30.128-29.147-45.095c-1.889-2.859-3.829-5.604-5.758-8.371 c-44.32-63.579-99.747-102.961-178.907-102.961c-4.138,0-8.348,0.109-12.619,0.322c-37.501,1.906-38.288,59.455-1.823,59.455 c0.6,0,1.204-0.018,1.823-0.048c4.118-0.208,8.196-0.317,12.248-0.317c37.958,0,72.889,9.693,100.27,38.501 c16.834,17.715,30.118,38.006,43.127,58.514c6.17,9.725,12.284,19.489,18.687,29.066c5.504,8.236,11.212,16.417,17.179,24.395 c17.012,22.729,36.308,43.757,60.271,59.336c25.929,16.854,54.01,24.272,83.172,26.354l-6.941,7.521 c-19.891,21.552,0.117,51.339,22.272,51.339c6.733,0,13.67-2.758,19.738-9.328l53.471-57.925 c12.954-14.035,8.947-31.529-1.519-42.046C434.574,299.763,419.224,280.076,403.151,260.978z\"/> </g> </g> </g>\n\r</svg>"),
|
||||
}
|
||||
var ResStarOutlineSvg = &fyne.StaticResource{
|
||||
StaticName: "star-outline.svg",
|
||||
StaticContent: []byte(
|
||||
@@ -100,6 +95,11 @@ var ResShuffleSvg = &fyne.StaticResource{
|
||||
StaticContent: []byte(
|
||||
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path fill=\"none\" d=\"M0 0h24v24H0z\"/>\n <path d=\"M18 17.883V16l5 3-5 3v-2.09a9 9 0 0 1-6.997-5.365L11 14.54l-.003.006A9 9 0 0 1 2.725 20H2v-2h.725a7 7 0 0 0 6.434-4.243L9.912 12l-.753-1.757A7 7 0 0 0 2.725 6H2V4h.725a9 9 0 0 1 8.272 5.455L11 9.46l.003-.006A9 9 0 0 1 18 4.09V2l5 3-5 3V6.117a7 7 0 0 0-5.159 4.126L12.088 12l.753 1.757A7 7 0 0 0 18 17.883z\"/>\n </g>\n</svg>"),
|
||||
}
|
||||
var ResUpdownarrowSvg = &fyne.StaticResource{
|
||||
StaticName: "updownarrow.svg",
|
||||
StaticContent: []byte(
|
||||
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path fill=\"none\" d=\"M0 0h24v24H0z\"/>\n <path d=\"M12 8H8.001L8 20H6V8H2l5-5 5 5zm10 8l-5 5-5-5h4V4h2v12h4z\"/>\n </g>\n</svg>\n"),
|
||||
}
|
||||
var ResDefaultToml = &fyne.StaticResource{
|
||||
StaticName: "default.toml",
|
||||
StaticContent: []byte(
|
||||
|
||||
+1
-1
@@ -9,7 +9,6 @@ fyne bundle -append -prefix Res icons/publicdomain/heart-outline.svg >> bundled.
|
||||
fyne bundle -append -prefix Res icons/publicdomain/musicnotes.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/people.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/playlist.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/shuffle-invert.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/star-outline.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/star-filled.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/theatermasks.svg >> bundled.go
|
||||
@@ -19,6 +18,7 @@ fyne bundle -append -prefix Res icons/publicdomain/filter.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/remix_design/repeat.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/remix_design/repeatone.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/remix_design/shuffle.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/remix_design/updownarrow.svg >> bundled.go
|
||||
|
||||
fyne bundle -append -prefix Res themes/default.toml >> bundled.go
|
||||
|
||||
|
||||
@@ -223,20 +223,24 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader {
|
||||
menuBtn := widget.NewButtonWithIcon("", theme.MoreHorizontalIcon(), nil)
|
||||
menuBtn.OnTapped = func() {
|
||||
if pop == nil {
|
||||
menu := fyne.NewMenu("",
|
||||
fyne.NewMenuItem("Add to queue", func() {
|
||||
queue := fyne.NewMenuItem("Add to queue", func() {
|
||||
go a.page.pm.LoadAlbum(a.albumID, true /*append*/, false /*shuffle*/)
|
||||
}),
|
||||
fyne.NewMenuItem("Add to playlist...", func() {
|
||||
})
|
||||
queue.Icon = theme.ContentAddIcon()
|
||||
playlist := fyne.NewMenuItem("Add to playlist...", func() {
|
||||
a.page.contr.DoAddTracksToPlaylistWorkflow(
|
||||
sharedutil.TracksToIDs(a.page.tracks))
|
||||
}),
|
||||
fyne.NewMenuItem("Download...", func() {
|
||||
})
|
||||
playlist.Icon = myTheme.PlaylistIcon
|
||||
download := fyne.NewMenuItem("Download...", func() {
|
||||
a.page.contr.ShowDownloadDialog(a.page.tracks, a.titleLabel.String())
|
||||
}),
|
||||
fyne.NewMenuItem("Show Info...", func() {
|
||||
})
|
||||
download.Icon = theme.DownloadIcon()
|
||||
info := fyne.NewMenuItem("Show Info...", func() {
|
||||
a.page.contr.ShowAlbumInfoDialog(a.albumID, a.titleLabel.String(), a.cover.Image())
|
||||
}))
|
||||
})
|
||||
info.Icon = theme.InfoIcon()
|
||||
menu := fyne.NewMenu("", queue, playlist, download, info)
|
||||
pop = widget.NewPopUpMenu(menu, fyne.CurrentApp().Driver().CanvasForObject(a))
|
||||
}
|
||||
pos := fyne.CurrentApp().Driver().AbsolutePositionForObject(menuBtn)
|
||||
|
||||
@@ -72,13 +72,15 @@ func NewNowPlayingPage(
|
||||
a.tracklist.OnVisibleColumnsChanged = func(cols []string) {
|
||||
a.conf.TracklistColumns = cols
|
||||
}
|
||||
remove := fyne.NewMenuItem("Remove from queue", a.onRemoveSelectedFromQueue)
|
||||
remove.Icon = theme.ContentRemoveIcon()
|
||||
a.tracklist.Options = widgets.TracklistOptions{
|
||||
AutoNumber: true,
|
||||
DisablePlaybackMenu: true,
|
||||
DisableRating: !canRate,
|
||||
AuxiliaryMenuItems: []*fyne.MenuItem{
|
||||
util.NewReorderTracksSubmenu(a.doSetNewTrackOrder),
|
||||
fyne.NewMenuItem("Remove from queue", a.onRemoveSelectedFromQueue),
|
||||
remove,
|
||||
},
|
||||
}
|
||||
contr.ConnectTracklistActions(a.tracklist)
|
||||
|
||||
+15
-13
@@ -87,11 +87,13 @@ func newPlaylistPage(
|
||||
conf.TracklistColumns = cols
|
||||
}
|
||||
_, canRate := a.sm.Server.(mediaprovider.SupportsRating)
|
||||
remove := fyne.NewMenuItem("Remove from playlist", a.onRemoveSelectedFromPlaylist)
|
||||
remove.Icon = theme.ContentClearIcon()
|
||||
a.tracklist.Options = widgets.TracklistOptions{
|
||||
DisableRating: !canRate,
|
||||
AuxiliaryMenuItems: []*fyne.MenuItem{
|
||||
util.NewReorderTracksSubmenu(a.doSetNewTrackOrder),
|
||||
fyne.NewMenuItem("Remove from playlist", a.onRemoveSelectedFromPlaylist),
|
||||
remove,
|
||||
},
|
||||
}
|
||||
// connect tracklist actions
|
||||
@@ -256,20 +258,20 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader {
|
||||
menuBtn := widget.NewButtonWithIcon("", theme.MoreHorizontalIcon(), nil)
|
||||
menuBtn.OnTapped = func() {
|
||||
if pop == nil {
|
||||
menu := fyne.NewMenu("",
|
||||
fyne.NewMenuItem("Add to queue", func() {
|
||||
a.page.pm.LoadPlaylist(a.page.playlistID, true /*append*/, false /*shuffle*/)
|
||||
}),
|
||||
fyne.NewMenuItem("Add to playlist...", func() {
|
||||
queue := fyne.NewMenuItem("Add to queue", func() {
|
||||
go a.page.pm.LoadPlaylist(a.page.playlistID, true /*append*/, false /*shuffle*/)
|
||||
})
|
||||
queue.Icon = theme.ContentAddIcon()
|
||||
playlist := fyne.NewMenuItem("Add to playlist...", func() {
|
||||
a.page.contr.DoAddTracksToPlaylistWorkflow(
|
||||
sharedutil.TracksToIDs(a.page.tracks))
|
||||
}),
|
||||
fyne.NewMenuItem("Download...", func() {
|
||||
if a.playlistInfo == nil {
|
||||
return
|
||||
}
|
||||
a.page.contr.ShowDownloadDialog(a.page.tracks, a.playlistInfo.Name)
|
||||
}))
|
||||
})
|
||||
playlist.Icon = myTheme.PlaylistIcon
|
||||
download := fyne.NewMenuItem("Download...", func() {
|
||||
a.page.contr.ShowDownloadDialog(a.page.tracks, a.titleLabel.String())
|
||||
})
|
||||
download.Icon = theme.DownloadIcon()
|
||||
menu := fyne.NewMenu("", queue, playlist, download)
|
||||
pop = widget.NewPopUpMenu(menu, fyne.CurrentApp().Driver().CanvasForObject(a))
|
||||
}
|
||||
pos := fyne.CurrentApp().Driver().AbsolutePositionForObject(menuBtn)
|
||||
|
||||
@@ -37,6 +37,7 @@ var (
|
||||
FilterIcon fyne.Resource = theme.NewThemedResource(res.ResFilterSvg)
|
||||
RepeatIcon fyne.Resource = theme.NewThemedResource(res.ResRepeatSvg)
|
||||
RepeatOneIcon fyne.Resource = theme.NewThemedResource(res.ResRepeatoneSvg)
|
||||
SortIcon fyne.Resource = theme.NewThemedResource(res.ResUpdownarrowSvg)
|
||||
)
|
||||
|
||||
type AppearanceMode string
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||
"github.com/dweymouth/supersonic/res"
|
||||
"github.com/dweymouth/supersonic/sharedutil"
|
||||
"github.com/dweymouth/supersonic/ui/layouts"
|
||||
myTheme "github.com/dweymouth/supersonic/ui/theme"
|
||||
@@ -170,6 +171,7 @@ func NewRatingSubmenu(onSetRating func(int)) *fyne.MenuItem {
|
||||
})
|
||||
}
|
||||
ratingMenu := fyne.NewMenuItem("Set rating", nil)
|
||||
ratingMenu.Icon = theme.NewThemedResource(res.ResStarOutlineSvg)
|
||||
ratingMenu.ChildMenu = fyne.NewMenu("", []*fyne.MenuItem{
|
||||
newRatingMenuItem(0),
|
||||
newRatingMenuItem(1),
|
||||
@@ -183,6 +185,7 @@ func NewRatingSubmenu(onSetRating func(int)) *fyne.MenuItem {
|
||||
|
||||
func NewReorderTracksSubmenu(onReorderTracks func(sharedutil.TrackReorderOp)) *fyne.MenuItem {
|
||||
reorderMenu := fyne.NewMenuItem("Reorder tracks", nil)
|
||||
reorderMenu.Icon = myTheme.SortIcon
|
||||
reorderMenu.ChildMenu = fyne.NewMenu("", []*fyne.MenuItem{
|
||||
fyne.NewMenuItem("Move to top", func() { onReorderTracks(sharedutil.MoveToTop) }),
|
||||
fyne.NewMenuItem("Move up", func() { onReorderTracks(sharedutil.MoveUp) }),
|
||||
|
||||
+17
-9
@@ -6,9 +6,11 @@ import (
|
||||
|
||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||
"github.com/dweymouth/supersonic/sharedutil"
|
||||
myTheme "github.com/dweymouth/supersonic/ui/theme"
|
||||
"github.com/dweymouth/supersonic/ui/util"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
@@ -311,24 +313,30 @@ func (g *GridView) cancelFetch() {
|
||||
func (g *GridView) showContextMenu(card *GridViewItem, pos fyne.Position) {
|
||||
g.menuGridViewItemId = card.ItemID()
|
||||
if g.menu == nil {
|
||||
g.menu = widget.NewPopUpMenu(fyne.NewMenu("",
|
||||
fyne.NewMenuItem("Play", func() { g.onPlay(g.menuGridViewItemId, false) }),
|
||||
fyne.NewMenuItem("Shuffle", func() { g.onPlay(g.menuGridViewItemId, true) }),
|
||||
fyne.NewMenuItem("Add to queue", func() {
|
||||
play := fyne.NewMenuItem("Play", func() { g.onPlay(g.menuGridViewItemId, false) })
|
||||
play.Icon = theme.MediaPlayIcon()
|
||||
shuffle := fyne.NewMenuItem("Shuffle", func() { g.onPlay(g.menuGridViewItemId, true) })
|
||||
shuffle.Icon = myTheme.ShuffleIcon
|
||||
queue := fyne.NewMenuItem("Add to queue", func() {
|
||||
if g.OnAddToQueue != nil {
|
||||
g.OnAddToQueue(g.menuGridViewItemId)
|
||||
}
|
||||
}),
|
||||
fyne.NewMenuItem("Add to playlist...", func() {
|
||||
})
|
||||
queue.Icon = theme.ContentAddIcon()
|
||||
playlist := fyne.NewMenuItem("Add to playlist...", func() {
|
||||
if g.OnAddToPlaylist != nil {
|
||||
g.OnAddToPlaylist(g.menuGridViewItemId)
|
||||
}
|
||||
}),
|
||||
fyne.NewMenuItem("Download...", func() {
|
||||
})
|
||||
playlist.Icon = myTheme.PlaylistIcon
|
||||
download := fyne.NewMenuItem("Download...", func() {
|
||||
if g.OnDownload != nil {
|
||||
g.OnDownload(g.menuGridViewItemId)
|
||||
}
|
||||
})),
|
||||
})
|
||||
download.Icon = theme.DownloadIcon()
|
||||
|
||||
g.menu = widget.NewPopUpMenu(fyne.NewMenu("", play, shuffle, queue, playlist, download),
|
||||
fyne.CurrentApp().Driver().CanvasForObject(g))
|
||||
}
|
||||
g.menu.ShowAtPosition(pos)
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"image"
|
||||
|
||||
"github.com/dweymouth/supersonic/ui/layouts"
|
||||
myTheme "github.com/dweymouth/supersonic/ui/theme"
|
||||
"github.com/dweymouth/supersonic/ui/util"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
@@ -129,11 +130,14 @@ func (n *NowPlayingCard) Update(track string, artists, artistIDs []string, album
|
||||
func (n *NowPlayingCard) showMenu(e *fyne.PointEvent) {
|
||||
if n.menu == nil {
|
||||
n.ratingMenu = util.NewRatingSubmenu(n.onSetRating)
|
||||
m := fyne.NewMenu("",
|
||||
fyne.NewMenuItem("Set favorite", func() { n.onSetFavorite(true) }),
|
||||
fyne.NewMenuItem("Unset favorite", func() { n.onSetFavorite(false) }),
|
||||
n.ratingMenu,
|
||||
fyne.NewMenuItem("Add to playlist...", func() { n.onAddToPlaylist() }))
|
||||
favorite := fyne.NewMenuItem("Set favorite", func() { n.onSetFavorite(true) })
|
||||
favorite.Icon = myTheme.FavoriteIcon
|
||||
unfavorite := fyne.NewMenuItem("Unset favorite", func() { n.onSetFavorite(false) })
|
||||
unfavorite.Icon = myTheme.NotFavoriteIcon
|
||||
playlist := fyne.NewMenuItem("Add to playlist...", func() { n.onAddToPlaylist() })
|
||||
playlist.Icon = myTheme.PlaylistIcon
|
||||
|
||||
m := fyne.NewMenu("", favorite, unfavorite, n.ratingMenu, playlist)
|
||||
n.menu = widget.NewPopUpMenu(m, fyne.CurrentApp().Driver().CanvasForObject(n))
|
||||
}
|
||||
n.ratingMenu.Disabled = n.DisableRating
|
||||
|
||||
+26
-22
@@ -534,44 +534,48 @@ func (t *Tracklist) onShowContextMenu(e *fyne.PointEvent, trackIdx int) {
|
||||
if t.ctxMenu == nil {
|
||||
t.ctxMenu = fyne.NewMenu("")
|
||||
if !t.Options.DisablePlaybackMenu {
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items,
|
||||
fyne.NewMenuItem("Play", func() {
|
||||
play := fyne.NewMenuItem("Play", func() {
|
||||
if t.OnPlaySelection != nil {
|
||||
t.OnPlaySelection(t.selectedTracks(), false)
|
||||
}
|
||||
}))
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items,
|
||||
fyne.NewMenuItem("Shuffle", func() {
|
||||
})
|
||||
play.Icon = theme.MediaPlayIcon()
|
||||
shuffle := fyne.NewMenuItem("Shuffle", func() {
|
||||
if t.OnPlaySelection != nil {
|
||||
t.OnPlaySelection(t.selectedTracks(), true)
|
||||
}
|
||||
}))
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items,
|
||||
fyne.NewMenuItem("Add to queue", func() {
|
||||
})
|
||||
shuffle.Icon = myTheme.ShuffleIcon
|
||||
add := fyne.NewMenuItem("Add to queue", func() {
|
||||
if t.OnPlaySelection != nil {
|
||||
t.OnAddToQueue(t.selectedTracks())
|
||||
}
|
||||
}))
|
||||
}
|
||||
})
|
||||
add.Icon = theme.ContentAddIcon()
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items,
|
||||
fyne.NewMenuItem("Add to playlist...", func() {
|
||||
play, shuffle, add)
|
||||
}
|
||||
playlist := fyne.NewMenuItem("Add to playlist...", func() {
|
||||
if t.OnAddToPlaylist != nil {
|
||||
t.OnAddToPlaylist(t.SelectedTrackIDs())
|
||||
}
|
||||
}))
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items,
|
||||
fyne.NewMenuItem("Download...", func() {
|
||||
})
|
||||
playlist.Icon = myTheme.PlaylistIcon
|
||||
download := fyne.NewMenuItem("Download...", func() {
|
||||
t.onDownload(t.selectedTracks(), "Selected tracks")
|
||||
}))
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items, fyne.NewMenuItemSeparator())
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items,
|
||||
fyne.NewMenuItem("Set favorite", func() {
|
||||
})
|
||||
download.Icon = theme.DownloadIcon()
|
||||
favorite := fyne.NewMenuItem("Set favorite", func() {
|
||||
t.onSetFavorites(t.selectedTracks(), true, true)
|
||||
}))
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items,
|
||||
fyne.NewMenuItem("Unset favorite", func() {
|
||||
})
|
||||
favorite.Icon = myTheme.FavoriteIcon
|
||||
unfavorite := fyne.NewMenuItem("Unset favorite", func() {
|
||||
t.onSetFavorites(t.selectedTracks(), false, true)
|
||||
}))
|
||||
})
|
||||
unfavorite.Icon = myTheme.NotFavoriteIcon
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items, playlist, download)
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items, fyne.NewMenuItemSeparator())
|
||||
t.ctxMenu.Items = append(t.ctxMenu.Items, favorite, unfavorite)
|
||||
t.ratingSubmenu = util.NewRatingSubmenu(func(rating int) {
|
||||
t.onSetRatings(t.selectedTracks(), rating, true)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user