restore scroll position when navigating back to Album and Playlist pages

This commit is contained in:
Drew Weymouth
2025-04-14 08:44:13 -07:00
parent 2985e08807
commit 6e7ad7225d
5 changed files with 33 additions and 10 deletions
+9 -1
View File
@@ -215,10 +215,18 @@ func (t *Tracklist) SetLoading(loading bool) {
}
}
func (t *Tracklist) Scroll(amount float32) {
func (t *Tracklist) ScrollBy(amount float32) {
t.list.ScrollToOffset(t.list.GetScrollOffset() + amount)
}
func (t *Tracklist) GetScrollOffset() float32 {
return t.list.GetScrollOffset()
}
func (t *Tracklist) ScrollToOffset(offset float32) {
t.list.ScrollToOffset(offset)
}
// Gets the track at the given index.
func (t *Tracklist) TrackAt(idx int) *mediaprovider.Track {
if idx >= len(t.tracks) {