From 21e90957caf7aa4a0adf06bda94692ccad8361da Mon Sep 17 00:00:00 2001 From: heliguy4599 Date: Sun, 13 Oct 2024 21:38:52 -0400 Subject: [PATCH] Improve shortcuts UX --- src/gtk/help-overlay.blp | 34 +++++++++++----------------------- src/main.py | 6 +++--- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/gtk/help-overlay.blp b/src/gtk/help-overlay.blp index 44e467a..13e5206 100644 --- a/src/gtk/help-overlay.blp +++ b/src/gtk/help-overlay.blp @@ -53,28 +53,24 @@ ShortcutsWindow help_overlay { } ShortcutsGroup { title: _("Packages Page"); - ShortcutsShortcut { - title: _("Selection Mode"); - action-name: "app.toggle-select-mode"; - } ShortcutsShortcut { title: _("Search Mode"); - action-name: "app.toggle-search-mode"; + action-name: "app.search-mode"; } ShortcutsShortcut { title: _("Edit Filters"); action-name: "app.filter"; } ShortcutsShortcut { - title: _("Uninstall Selected Packages"); - action-name: "app.delete"; + title: _("Selection Mode"); + action-name: "app.toggle-select-mode"; } } ShortcutsGroup { title: _("Remotes Page"); ShortcutsShortcut { title: _("Search Mode"); - action-name: "app.toggle-search-mode"; + action-name: "app.search-mode"; } ShortcutsShortcut { title: _("Show or Hide Disabled Remotes"); @@ -87,21 +83,17 @@ ShortcutsWindow help_overlay { } ShortcutsGroup { title: _("User Data Page"); - ShortcutsShortcut { - title: _("Selection Mode"); - action-name: "app.toggle-select-mode"; - } ShortcutsShortcut { title: _("Search Mode"); - action-name: "app.toggle-search-mode"; + action-name: "app.search-mode"; } ShortcutsShortcut { title: _("Edit Sorting Modes"); action-name: "app.filter"; } ShortcutsShortcut { - title: _("Trash Selected Data"); - action-name: "app.delete"; + title: _("Selection Mode"); + action-name: "app.toggle-select-mode"; } ShortcutsShortcut { title: _("Show Active Data"); @@ -114,18 +106,14 @@ ShortcutsWindow help_overlay { } ShortcutsGroup { title: _("Snapshots Page"); + ShortcutsShortcut { + title: _("Search Mode"); + action-name: "app.search-mode"; + } ShortcutsShortcut { title: _("Selection Mode"); action-name: "app.toggle-select-mode"; } - ShortcutsShortcut { - title: _("Search Mode"); - action-name: "app.toggle-search-mode"; - } - ShortcutsShortcut { - title: _("Trash Selected Snapshots"); - action-name: "app.delete"; - } ShortcutsShortcut { title: _("New Snapshots"); action-name: "app.new"; diff --git a/src/main.py b/src/main.py index 6fe7a35..50d1494 100644 --- a/src/main.py +++ b/src/main.py @@ -57,7 +57,7 @@ class WarehouseApplication(Adw.Application): self.create_action("toggle-select-mode", self.on_toggle_select_mode_shortcut, ["b", "Return"]) self.create_action("toggle-selection-kp-enter", self.on_toggle_select_mode_shortcut, ["KP_Enter"]) # Doesn't show in the shortcuts window - self.create_action("toggle-search-mode", self.on_toggle_search_mode_shortcut, ["f"]) + self.create_action("search-mode", self.on_search_mode_shortcut, ["f"]) self.create_action("filter", self.on_filter_shortcut, ["t"]) self.create_action("new", self.on_new_shortcut, ["n"]) self.create_action("active-data-view", lambda *_: self.on_data_view_shortcut(True), ["1"]) @@ -125,10 +125,10 @@ class WarehouseApplication(Adw.Application): except AttributeError: pass - def on_toggle_search_mode_shortcut(self, *args): + def on_search_mode_shortcut(self, *args): try: button = self.props.active_window.stack.get_visible_child().search_button - button.set_active(not button.get_active()) + button.set_active(True) except AttributeError: pass