From: Plom Heller Date: Sat, 18 Apr 2026 03:58:14 +0000 (+0200) Subject: Add .last_mod_time, .name to attributes allowing filtering. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/edit?a=commitdiff_plain;h=HEAD;p=stable_plom Add .last_mod_time, .name to attributes allowing filtering. --- diff --git a/browser/gallery_config.py b/browser/gallery_config.py index 18bc3af..cbd77ab 100644 --- a/browser/gallery_config.py +++ b/browser/gallery_config.py @@ -17,6 +17,9 @@ gi.require_version('Gio', '2.0') from gi.repository import Gio, GObject, Gtk, Pango # type: ignore # noqa: E402 +ALWAYS_ORDERS = ['bookmarked', 'last_mod_time', 'name'] + + class SorterAndFilterer(GObject.GObject): """Sort order box representation of sorting/filtering attribute.""" widget: Gtk.Box @@ -147,7 +150,7 @@ class SorterAndFiltererOrder: @classmethod def from_suggestion(cls, suggestion: list[str]) -> Self: """Create new, interpreting order of strings in suggestion.""" - names: list[str] = [p.lower() for p in GEN_PARAMS] + ['bookmarked'] + names: list[str] = [p.lower() for p in GEN_PARAMS] + ALWAYS_ORDERS order: list[SorterAndFilterer] = [] for name in names: order += [SorterAndFilterer(name)]