aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreerielili <lionel@les-miquelots.net>2024-09-22 11:27:55 +0000
committerGitHub <noreply@github.com>2024-09-22 13:27:55 +0200
commitd20553a111af4fb69e19ba8caeb0044035086c43 (patch)
tree3f311d27840059ecfa29e758973cd501f8735955
parent3a4ac7c11d93553a485aa7dec9be05d71a7c9cb6 (diff)
downloaddino-d20553a111af4fb69e19ba8caeb0044035086c43.tar.gz
dino-d20553a111af4fb69e19ba8caeb0044035086c43.zip
Add keyboard shortcut to show preferences (Ctrl+,) (#1435)HEADmaster
-rw-r--r--main/data/gtk/help-overlay.ui6
-rw-r--r--main/src/ui/application.vala2
2 files changed, 8 insertions, 0 deletions
diff --git a/main/data/gtk/help-overlay.ui b/main/data/gtk/help-overlay.ui
index 17b0555c..92c3d74b 100644
--- a/main/data/gtk/help-overlay.ui
+++ b/main/data/gtk/help-overlay.ui
@@ -22,6 +22,12 @@
</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>
<property name="title" translatable="yes">Keyboard shortcuts</property>
</object>
diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala
index 706a61e6..918fb26c 100644
--- a/main/src/ui/application.vala
+++ b/main/src/ui/application.vala
@@ -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;
@@ -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) => {