a few more goroutines
This commit is contained in:
@@ -297,7 +297,8 @@ func (a *NowPlayingPage) onImageLoaded(img image.Image, err error) {
|
||||
if err != nil {
|
||||
log.Printf("error loading cover art: %v\n", err)
|
||||
}
|
||||
a.card.SetCoverImage(img)
|
||||
|
||||
fyne.Do(func() { a.card.SetCoverImage(img) })
|
||||
if img == nil {
|
||||
return
|
||||
}
|
||||
@@ -307,18 +308,15 @@ func (a *NowPlayingPage) onImageLoaded(img image.Image, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
evenFrame := true
|
||||
// Fyne animation starting is currently thread-safe,
|
||||
// despite not being marked as such
|
||||
// TODO: if this changes, use fyne.Do
|
||||
anim := canvas.NewColorRGBAAnimation(
|
||||
a.background.StartColor, c, 75*time.Millisecond, func(c color.Color) {
|
||||
// reduce fps to reduce mem allocations
|
||||
if evenFrame {
|
||||
a.background.StartColor = c
|
||||
a.background.Refresh()
|
||||
}
|
||||
evenFrame = !evenFrame
|
||||
a.background.StartColor = c
|
||||
a.background.Refresh()
|
||||
})
|
||||
anim.Start()
|
||||
|
||||
}
|
||||
|
||||
func (a *NowPlayingPage) updateLyrics() {
|
||||
|
||||
Reference in New Issue
Block a user