fix: better play button icon usage

This commit is contained in:
José Carlos Cuevas 2023-12-06 16:29:50 +01:00
parent 91c2d22253
commit 0a75f65a02

View file

@ -390,22 +390,22 @@ func main() {
}
}()
playButton = widget.NewButtonWithIcon("", theme.MediaStopIcon(), func() {
playButton = widget.NewButtonWithIcon("", theme.MediaPlayIcon(), func() {
// Here we control each time the button is pressed and update its
// appearance anytime it is clicked. We make the player start playing
// or pause.
if !streamPlayer.IsPlaying() {
playButton.SetIcon(theme.MediaPlayIcon())
playButton.SetIcon(theme.MediaPauseIcon())
streamPlayer.Load(RADIOSPIRAL_STREAM)
streamPlayer.Play()
playStatus = true
} else {
if playStatus {
playStatus = false
playButton.SetIcon(theme.MediaPauseIcon())
playButton.SetIcon(theme.MediaPlayIcon())
} else {
playStatus = true
playButton.SetIcon(theme.MediaPlayIcon())
playButton.SetIcon(theme.MediaPauseIcon())
}
streamPlayer.Pause()
}