Fix setting sort order on Library panel (close #91)

This commit is contained in:
coderkun 2023-01-18 17:25:29 +01:00
parent a1e87e8994
commit e976e05efe

View file

@ -114,6 +114,12 @@ class LibraryToolbar(Gtk.ButtonBox):
self.select_button.set_active(False)
def set_sort_order(self, sort):
button = self._toolbar_sort_buttons[sort]
if button and not button.get_active():
button.set_active(True)
@Gtk.Template(resource_path='/xyz/suruatoel/mcg/ui/library-panel.ui')
@ -389,11 +395,9 @@ class LibraryPanel(Gtk.Stack):
def set_sort_order(self, sort):
if self._sort_order != sort:
button = self._toolbar_sort_buttons[sort]
if button and not button.get_active():
button.set_active(True)
self._sort_order = sort
self._library_grid_model.set_sort_func(2, self.compare_albums, self._sort_order)
self._toolbar.set_sort_order(sort)
self._sort_order = sort
self._library_grid_model.set_sort_func(2, self.compare_albums, self._sort_order)
def get_sort_order(self):