Set last_played as the default sort mode
This commit is contained in:
@@ -161,13 +161,13 @@ class CartridgesApplication(Adw.Application):
|
||||
)
|
||||
|
||||
sort_action = Gio.SimpleAction.new_stateful(
|
||||
"sort_by", GLib.VariantType.new("s"), GLib.Variant("s", "a-z")
|
||||
"sort_by",
|
||||
GLib.VariantType.new("s"),
|
||||
sort_mode := GLib.Variant("s", shared.state_schema.get_string("sort-mode")),
|
||||
)
|
||||
sort_action.connect("activate", shared.win.on_sort_action)
|
||||
shared.win.add_action(sort_action)
|
||||
shared.win.on_sort_action(
|
||||
sort_action, shared.state_schema.get_value("sort-mode")
|
||||
)
|
||||
shared.win.on_sort_action(sort_action, sort_mode)
|
||||
|
||||
if self.init_search_term: # For command line activation
|
||||
shared.win.search_bar.set_search_mode(True)
|
||||
|
||||
@@ -81,7 +81,7 @@ class CartridgesWindow(Adw.ApplicationWindow):
|
||||
toasts: dict = {}
|
||||
active_game: Game
|
||||
details_view_game_cover: Optional[GameCover] = None
|
||||
sort_state: str = "a-z"
|
||||
sort_state: str = "last_played"
|
||||
filter_state: str = "all"
|
||||
source_rows: dict = {}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<choice value="oldest" />
|
||||
<choice value="last_played" />
|
||||
</choices>
|
||||
<default>"a-z"</default>
|
||||
<default>"last_played"</default>
|
||||
</key>
|
||||
<key name="show-sidebar" type="b">
|
||||
<default>false</default>
|
||||
|
||||
Reference in New Issue
Block a user