more fyne.Dos

This commit is contained in:
Drew Weymouth
2025-02-08 08:35:34 -03:00
parent 61bfbeb349
commit e72e56db1c
3 changed files with 50 additions and 51 deletions
+24 -18
View File
@@ -255,30 +255,36 @@ func (b *BrowsingPane) doSetPage(p Page) bool {
}
func (b *BrowsingPane) onSongChange(song mediaprovider.MediaItem, lastScrobbledIfAny *mediaprovider.Track) {
if b.curPage == nil {
return
}
if p, ok := b.curPage.(CanShowNowPlaying); ok {
fyne.Do(func() { p.OnSongChange(song, lastScrobbledIfAny) })
}
fyne.Do(func() {
if b.curPage == nil {
return
}
if p, ok := b.curPage.(CanShowNowPlaying); ok {
p.OnSongChange(song, lastScrobbledIfAny)
}
})
}
func (b *BrowsingPane) onPlayTimeUpdate(cur, total float64, seeked bool) {
if b.curPage == nil {
return
}
if p, ok := b.curPage.(CanShowPlayTime); ok {
p.OnPlayTimeUpdate(cur, total, seeked)
}
fyne.Do(func() {
if b.curPage == nil {
return
}
if p, ok := b.curPage.(CanShowPlayTime); ok {
p.OnPlayTimeUpdate(cur, total, seeked)
}
})
}
func (b *BrowsingPane) onQueueChange() {
if b.curPage == nil {
return
}
if p, ok := b.curPage.(CanShowPlayQueue); ok {
p.OnPlayQueueChange()
}
fyne.Do(func() {
if b.curPage == nil {
return
}
if p, ok := b.curPage.(CanShowPlayQueue); ok {
p.OnPlayQueueChange()
}
})
}
func (b *BrowsingPane) addPageToHistory(p Page, truncate bool) {