switch to simpler way of themeing PNG icons
This commit is contained in:
@@ -170,7 +170,7 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader {
|
||||
playButton := widget.NewButtonWithIcon("Play", theme.MediaPlayIcon(), func() {
|
||||
go page.pm.PlayAlbum(page.albumID, 0)
|
||||
})
|
||||
shuffleBtn := widgets.NewThemedIconButton(myTheme.IconNameShuffle, " Shuffle", func() {
|
||||
shuffleBtn := widget.NewButtonWithIcon(" Shuffle", myTheme.ShuffleIcon, func() {
|
||||
page.pm.LoadTracks(page.tracklist.Tracks, false, true)
|
||||
page.pm.PlayFromBeginning()
|
||||
})
|
||||
|
||||
@@ -254,7 +254,7 @@ type ArtistPageHeader struct {
|
||||
similarArtists *fyne.Container
|
||||
favoriteBtn *widgets.FavoriteButton
|
||||
playBtn *widget.Button
|
||||
playRadioBtn *widgets.ThemedIconButton
|
||||
playRadioBtn *widget.Button
|
||||
container *fyne.Container
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ func NewArtistPageHeader(page *ArtistPage) *ArtistPageHeader {
|
||||
}
|
||||
a.favoriteBtn = widgets.NewFavoriteButton(func() { go a.toggleFavorited() })
|
||||
a.playBtn = widget.NewButtonWithIcon("Play Discography", theme.MediaPlayIcon(), page.playAllTracks)
|
||||
a.playRadioBtn = widgets.NewThemedIconButton(myTheme.IconNameShuffle, " Play Artist Radio", page.playArtistRadio)
|
||||
a.playRadioBtn = widget.NewButtonWithIcon(" Play Artist Radio", myTheme.ShuffleIcon, page.playArtistRadio)
|
||||
a.biographyDisp.Wrapping = fyne.TextWrapWord
|
||||
a.ExtendBaseWidget(a)
|
||||
a.createContainer()
|
||||
|
||||
@@ -107,25 +107,25 @@ func (b *BrowsingPane) AddSettingsMenuItem(label string, action func()) {
|
||||
fyne.NewMenuItem(label, action))
|
||||
}
|
||||
|
||||
func (b *BrowsingPane) AddNavigationButton(iconName fyne.ThemeIconName, action func()) {
|
||||
b.navBtnsContainer.Add(widgets.NewThemedIconButton(iconName, "", action))
|
||||
func (b *BrowsingPane) AddNavigationButton(icon fyne.Resource, action func()) {
|
||||
b.navBtnsContainer.Add(widget.NewButtonWithIcon("", icon, action))
|
||||
}
|
||||
|
||||
func (b *BrowsingPane) DisableNavigationButtons() {
|
||||
for _, obj := range b.navBtnsContainer.Objects {
|
||||
obj.(*widgets.ThemedIconButton).Disable()
|
||||
obj.(*widget.Button).Disable()
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BrowsingPane) EnableNavigationButtons() {
|
||||
for _, obj := range b.navBtnsContainer.Objects {
|
||||
obj.(*widgets.ThemedIconButton).Enable()
|
||||
obj.(*widget.Button).Enable()
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BrowsingPane) ActivateNavigationButton(num int) {
|
||||
if num < len(b.navBtnsContainer.Objects) {
|
||||
btn := b.navBtnsContainer.Objects[num].(*widgets.ThemedIconButton)
|
||||
btn := b.navBtnsContainer.Objects[num].(*widget.Button)
|
||||
if !btn.Disabled() {
|
||||
btn.OnTapped()
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type GenrePage struct {
|
||||
searcher *widgets.Searcher
|
||||
searchText string
|
||||
titleDisp *widget.RichText
|
||||
playRandom *widgets.ThemedIconButton
|
||||
playRandom *widget.Button
|
||||
|
||||
OnPlayAlbum func(string, int)
|
||||
|
||||
@@ -50,7 +50,7 @@ func NewGenrePage(genre string, contr *controller.Controller, pm *backend.Playba
|
||||
g.titleDisp.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
|
||||
SizeName: theme.SizeNameHeadingText,
|
||||
}
|
||||
g.playRandom = widgets.NewThemedIconButton(myTheme.IconNameShuffle, " Play random", g.playRandomSongs)
|
||||
g.playRandom = widget.NewButtonWithIcon(" Play random", myTheme.ShuffleIcon, g.playRandomSongs)
|
||||
iter := g.lm.GenreIter(g.genre)
|
||||
g.grid = widgets.NewGridView(widgets.NewGridViewAlbumIterator(iter), g.im)
|
||||
g.grid.OnPlay = g.onPlayAlbum
|
||||
@@ -93,7 +93,7 @@ func restoreGenrePage(saved *savedGenrePage) *GenrePage {
|
||||
g.titleDisp.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
|
||||
SizeName: theme.SizeNameHeadingText,
|
||||
}
|
||||
g.playRandom = widgets.NewThemedIconButton(myTheme.IconNameShuffle, "Play random", g.playRandomSongs)
|
||||
g.playRandom = widget.NewButtonWithIcon("Play random", myTheme.ShuffleIcon, g.playRandomSongs)
|
||||
g.grid = widgets.NewAlbumGridFromState(saved.gridState)
|
||||
g.searcher = widgets.NewSearcher()
|
||||
g.searcher.OnSearched = g.OnSearched
|
||||
|
||||
@@ -206,7 +206,7 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader {
|
||||
page.pm.PlayFromBeginning()
|
||||
})
|
||||
// TODO: find way to pad shuffle svg rather than using a space in the label string
|
||||
shuffleBtn := widgets.NewThemedIconButton(myTheme.IconNameShuffle, " Shuffle", func() {
|
||||
shuffleBtn := widget.NewButtonWithIcon(" Shuffle", myTheme.ShuffleIcon, func() {
|
||||
page.pm.LoadTracks(page.tracklist.Tracks, false /*append*/, true /*shuffle*/)
|
||||
page.pm.PlayFromBeginning()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user