Skip to content

Commit

Permalink
Add keyboard shortcut to show preferences (Ctrl+,) (#1435)
Browse files Browse the repository at this point in the history
  • Loading branch information
eerielili authored Sep 22, 2024
1 parent 3a4ac7c commit d20553a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main/data/gtk/help-overlay.ui
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
<property name="title" translatable="yes">Join Channel</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;ctrl&gt;comma</property>
<property name="title" translatable="yes">Show preferences</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;ctrl&gt;question</property>
Expand Down
2 changes: 2 additions & 0 deletions main/src/ui/application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application {
private const string[] KEY_COMBINATION_ADD_CONFERENCE = {"<Ctrl>G", null};
private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS = {"<Ctrl>Tab", null};
private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS_REV = {"<Ctrl><Shift>Tab", null};
private const string[] KEY_COMBINATION_SHOW_SETTINGS = {"<Ctrl>comma", null};

private MainWindow window;
public MainWindowController controller;
Expand Down Expand Up @@ -116,6 +117,7 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application {
SimpleAction preferences_action = new SimpleAction("preferences", null);
preferences_action.activate.connect(show_preferences_window);
add_action(preferences_action);
set_accels_for_action("app.preferences", KEY_COMBINATION_SHOW_SETTINGS);

SimpleAction preferences_account_action = new SimpleAction("preferences-account", VariantType.INT32);
preferences_account_action.activate.connect((variant) => {
Expand Down

0 comments on commit d20553a

Please sign in to comment.