more fyne.Do updates

This commit is contained in:
Drew Weymouth
2025-02-08 08:35:34 -03:00
parent c7adeb5e32
commit 61bfbeb349
5 changed files with 30 additions and 24 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ require (
github.com/deluan/sanitize v0.0.0-20230310221930-6e18967d9fc1 github.com/deluan/sanitize v0.0.0-20230310221930-6e18967d9fc1
github.com/dweymouth/fyne-advanced-list v0.0.0-20240806013530-392de9d6a2a1 github.com/dweymouth/fyne-advanced-list v0.0.0-20240806013530-392de9d6a2a1
github.com/dweymouth/fyne-lyrics v0.0.0-20240528234907-15eee7ce5e64 github.com/dweymouth/fyne-lyrics v0.0.0-20240528234907-15eee7ce5e64
github.com/dweymouth/fyne-tooltip v0.2.0 github.com/dweymouth/fyne-tooltip v0.2.2-0.20250130121815-99d48eaa2e5b
github.com/dweymouth/go-jellyfin v0.0.0-20240517151952-5ceca61cb645 github.com/dweymouth/go-jellyfin v0.0.0-20240517151952-5ceca61cb645
github.com/godbus/dbus/v5 v5.1.0 github.com/godbus/dbus/v5 v5.1.0
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0
@@ -63,4 +63,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )
replace fyne.io/fyne/v2 v2.5.3 => github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250112004415-0d8cb89956b0 replace fyne.io/fyne/v2 v2.5.3 => github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250129162414-0b5d9f71fefd
+4 -4
View File
@@ -79,10 +79,10 @@ github.com/dweymouth/fyne-advanced-list v0.0.0-20240806013530-392de9d6a2a1 h1:NT
github.com/dweymouth/fyne-advanced-list v0.0.0-20240806013530-392de9d6a2a1/go.mod h1:sbOhla4VcfFb4OjXiUFTLXMPTnhRUlVrDMhB8HtWR4o= github.com/dweymouth/fyne-advanced-list v0.0.0-20240806013530-392de9d6a2a1/go.mod h1:sbOhla4VcfFb4OjXiUFTLXMPTnhRUlVrDMhB8HtWR4o=
github.com/dweymouth/fyne-lyrics v0.0.0-20240528234907-15eee7ce5e64 h1:RUIrnGY034rDMlcOui/daurwX5b+52KdUKhH9aXaDSg= github.com/dweymouth/fyne-lyrics v0.0.0-20240528234907-15eee7ce5e64 h1:RUIrnGY034rDMlcOui/daurwX5b+52KdUKhH9aXaDSg=
github.com/dweymouth/fyne-lyrics v0.0.0-20240528234907-15eee7ce5e64/go.mod h1:3YrjFDHMlhCsSZ/OvmJCxWm9QHSgOVWZBxnraZz9Z7c= github.com/dweymouth/fyne-lyrics v0.0.0-20240528234907-15eee7ce5e64/go.mod h1:3YrjFDHMlhCsSZ/OvmJCxWm9QHSgOVWZBxnraZz9Z7c=
github.com/dweymouth/fyne-tooltip v0.2.0 h1:6Zy3gryctuPoQfYf8Xp3tjenioebMt11NBGW/QXIvxE= github.com/dweymouth/fyne-tooltip v0.2.2-0.20250130121815-99d48eaa2e5b h1:dL564SsyJ6tDoxEqR7zF3kABuuYoy5givaYS1OQhSdI=
github.com/dweymouth/fyne-tooltip v0.2.0/go.mod h1:zEgy7p9tSVIuy2GufFbOCoK3Q04zhyDPOotlU4G3Ma4= github.com/dweymouth/fyne-tooltip v0.2.2-0.20250130121815-99d48eaa2e5b/go.mod h1:Hb8cbvkWyq2SGPVyoTpQYhL7BZsOF9uhiFWyz9cVgko=
github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250112004415-0d8cb89956b0 h1:YoIIY7CcgUdlfaagC6C8ADwXu9BDJNbhJYQi6g/7xZY= github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250129162414-0b5d9f71fefd h1:/FrXTVd41Xs3IKArVDzaM4ACOxQjU9KbdGxbM+yaBSc=
github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250112004415-0d8cb89956b0/go.mod h1:6/uEYg4FEhspAcWgsokutm9wFMHDNSYuEHCKTYWSho8= github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20250129162414-0b5d9f71fefd/go.mod h1:6/uEYg4FEhspAcWgsokutm9wFMHDNSYuEHCKTYWSho8=
github.com/dweymouth/go-jellyfin v0.0.0-20240517151952-5ceca61cb645 h1:KzqSaQwG3HsTZQlEtkp0BeUy9vmYZ0rq0B15qIPSiBs= github.com/dweymouth/go-jellyfin v0.0.0-20240517151952-5ceca61cb645 h1:KzqSaQwG3HsTZQlEtkp0BeUy9vmYZ0rq0B15qIPSiBs=
github.com/dweymouth/go-jellyfin v0.0.0-20240517151952-5ceca61cb645/go.mod h1:fcUagHBaQnt06GmBAllNE0J4O/7064zXRWdqnTTtVjI= github.com/dweymouth/go-jellyfin v0.0.0-20240517151952-5ceca61cb645/go.mod h1:fcUagHBaQnt06GmBAllNE0J4O/7064zXRWdqnTTtVjI=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+17 -13
View File
@@ -33,19 +33,21 @@ func NewBottomPanel(pm *backend.PlaybackManager, im *backend.ImageManager, contr
pm.OnSongChange(bp.onSongChange) pm.OnSongChange(bp.onSongChange)
pm.OnPlayTimeUpdate(func(cur, total float64, _ bool) { pm.OnPlayTimeUpdate(func(cur, total float64, _ bool) {
if !pm.IsSeeking() { fyne.Do(func() {
bp.Controls.UpdatePlayTime(cur, total) if !pm.IsSeeking() {
} bp.Controls.UpdatePlayTime(cur, total)
}
})
}) })
pm.OnPaused(func() { pm.OnPaused(func() {
bp.Controls.SetPlaying(false) fyne.Do(func() { bp.Controls.SetPlaying(false) })
}) })
pm.OnPlaying(func() { pm.OnPlaying(func() {
bp.Controls.SetPlaying(true) fyne.Do(func() { bp.Controls.SetPlaying(true) })
}) })
pm.OnStopped(func() { pm.OnStopped(func() {
bp.Controls.SetPlaying(false) fyne.Do(func() { bp.Controls.SetPlaying(false) })
}) })
bp.NowPlaying = widgets.NewNowPlayingCard() bp.NowPlaying = widgets.NewNowPlayingCard()
@@ -124,13 +126,15 @@ func NewBottomPanel(pm *backend.PlaybackManager, im *backend.ImageManager, contr
} }
func (bp *BottomPanel) onSongChange(song mediaprovider.MediaItem, _ *mediaprovider.Track) { func (bp *BottomPanel) onSongChange(song mediaprovider.MediaItem, _ *mediaprovider.Track) {
if song == nil { fyne.Do(func() {
bp.NowPlaying.Update(nil) if song == nil {
bp.imageLoader.Load("") bp.NowPlaying.Update(nil)
} else { bp.imageLoader.Load("")
bp.NowPlaying.Update(song) } else {
bp.imageLoader.Load(song.Metadata().CoverArtID) bp.NowPlaying.Update(song)
} bp.imageLoader.Load(song.Metadata().CoverArtID)
}
})
} }
func (bp *BottomPanel) CreateRenderer() fyne.WidgetRenderer { func (bp *BottomPanel) CreateRenderer() fyne.WidgetRenderer {
+6 -4
View File
@@ -391,14 +391,16 @@ func (g *GridView) checkFetchMoreItems(count int) {
g.stateMutex.Lock() g.stateMutex.Lock()
g.items = append(g.items, items...) g.items = append(g.items, items...)
g.stateMutex.Unlock() g.stateMutex.Unlock()
g.loadingDots.Stop()
if len(items) < batchFetchSize { if len(items) < batchFetchSize {
g.done = true g.done = true
} }
n += len(items) n += len(items)
if len(items) > 0 { fyne.DoAndWait(func() {
g.grid.Refresh() g.loadingDots.Stop()
} if len(items) > 0 {
g.grid.Refresh()
}
})
} }
} }
} }
+1 -1
View File
@@ -71,7 +71,7 @@ func (l *LoadingDots) animate(ctx context.Context) {
l.running.Store(false) l.running.Store(false)
return return
case <-ticker.C: case <-ticker.C:
l.doTick(foreground, disabled) fyne.Do(func() { l.doTick(foreground, disabled) })
} }
} }
} }