improved auto scrolling in browser

This commit is contained in:
Martin Wagner 2022-08-27 13:53:28 +02:00
parent b1994fc4bc
commit 76c27816a8

View File

@ -1871,7 +1871,7 @@ class SelectionList(TreeView):
def scroll_to_path(self, path): def scroll_to_path(self, path):
self.set_cursor(Gtk.TreePath(len(self._store)), None, False) # unset cursor self.set_cursor(Gtk.TreePath(len(self._store)), None, False) # unset cursor
self.save_scroll_to_cell(path, None, False) self.save_scroll_to_cell(path, None, True, 0.25)
def scroll_to_selected(self): def scroll_to_selected(self):
self.scroll_to_path(self.get_path_selected()) self.scroll_to_path(self.get_path_selected())
@ -2276,6 +2276,7 @@ class Browser(Gtk.Paned):
self._artist_list.scroll_to_selected() self._artist_list.scroll_to_selected()
else: else:
self._artist_list.select(song["albumartist"][0]) self._artist_list.select(song["albumartist"][0])
self._genre_list.scroll_to_selected()
else: else:
self._genre_list.deactivate() self._genre_list.deactivate()
self._album_list.scroll_to_current_album() self._album_list.scroll_to_current_album()