From a40ba5eb79043712576b25c156bb255ccc1a79e1 Mon Sep 17 00:00:00 2001 From: Michael Manganiello Date: Tue, 20 Jun 2023 23:51:04 -0300 Subject: [PATCH] Update icons to the new Repeat ones --- ui/theme/theme.go | 2 ++ ui/widgets/auxcontrols.go | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ui/theme/theme.go b/ui/theme/theme.go index 8b2d484..889edd9 100644 --- a/ui/theme/theme.go +++ b/ui/theme/theme.go @@ -193,6 +193,8 @@ var ( ShuffleIcon fyne.Resource TracksIcon fyne.Resource FilterIcon fyne.Resource = theme.NewThemedResource(res.ResFilterSvg) + RepeatIcon fyne.Resource = theme.NewThemedResource(res.ResRepeatSvg) + RepeatOneIcon fyne.Resource = theme.NewThemedResource(res.ResRepeatoneSvg) ) // MUST be called at startup! diff --git a/ui/widgets/auxcontrols.go b/ui/widgets/auxcontrols.go index 85eacc9..0119e23 100644 --- a/ui/widgets/auxcontrols.go +++ b/ui/widgets/auxcontrols.go @@ -6,6 +6,8 @@ import ( "fyne.io/fyne/v2/layout" "fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/widget" + + myTheme "github.com/dweymouth/supersonic/ui/theme" "github.com/dweymouth/supersonic/ui/util" ) @@ -41,7 +43,7 @@ func (b *miniButton) MinSize() fyne.Size { func NewAuxControls(initialVolume int) *AuxControls { a := &AuxControls{ VolumeControl: NewVolumeControl(initialVolume), - loop: newMiniButton(theme.MediaReplayIcon()), + loop: newMiniButton(myTheme.RepeatIcon), } a.container = container.NewHBox( layout.NewSpacer(), @@ -68,13 +70,13 @@ func (a *AuxControls) OnChangeLoopMode(f func()) { func (a *AuxControls) SetLoopMode(mode string) { if mode == "all" { a.loop.Importance = widget.HighImportance - a.loop.Icon = theme.MediaReplayIcon() + a.loop.Icon = myTheme.RepeatIcon } else if mode == "one" { a.loop.Importance = widget.HighImportance - a.loop.Icon = theme.MediaReplayIcon() // TODO: This icon must be changed to the "Repeat" one with a 1. + a.loop.Icon = myTheme.RepeatOneIcon } else { a.loop.Importance = widget.MediumImportance - a.loop.Icon = theme.MediaReplayIcon() + a.loop.Icon = myTheme.RepeatIcon } a.loop.Refresh() }