mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
Improve shortcuts UX
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -57,7 +57,7 @@ class WarehouseApplication(Adw.Application):
|
||||
|
||||
self.create_action("toggle-select-mode", self.on_toggle_select_mode_shortcut, ["<primary>b", "<primary>Return"])
|
||||
self.create_action("toggle-selection-kp-enter", self.on_toggle_select_mode_shortcut, ["<primary>KP_Enter"]) # Doesn't show in the shortcuts window
|
||||
self.create_action("toggle-search-mode", self.on_toggle_search_mode_shortcut, ["<primary>f"])
|
||||
self.create_action("search-mode", self.on_search_mode_shortcut, ["<primary>f"])
|
||||
self.create_action("filter", self.on_filter_shortcut, ["<primary>t"])
|
||||
self.create_action("new", self.on_new_shortcut, ["<primary>n"])
|
||||
self.create_action("active-data-view", lambda *_: self.on_data_view_shortcut(True), ["<Alt>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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user