From da7be50f059e5a1536b58087d5cdb305bf86ef63 Mon Sep 17 00:00:00 2001 From: eerielili Date: Sun, 25 Jun 2023 11:39:07 +0000 Subject: [PATCH] Add a keyboard shortcut to show keyboard shortcuts (#1432) Add a keyboard shortcut to show keyboard shortcuts - It's Ctrl+? --- main/data/shortcuts.ui | 6 ++++++ main/src/ui/application.vala | 2 ++ 2 files changed, 8 insertions(+) diff --git a/main/data/shortcuts.ui b/main/data/shortcuts.ui index 30b5ab83..6cc5851a 100644 --- a/main/data/shortcuts.ui +++ b/main/data/shortcuts.ui @@ -20,6 +20,12 @@ Join Channel + + + <ctrl>question + Keyboard shortcuts + + diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala index 36f08f60..9ee3361a 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 = {"G", null}; private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS = {"Tab", null}; private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS_REV = {"Tab", null}; + private const string[] KEY_COMBINATION_SHOW_KEYBOARD_SHORTCUTS = {"question", null}; private MainWindow window; public MainWindowController controller; @@ -206,6 +207,7 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application { dialog.present(); }); add_action(open_shortcuts_action); + set_accels_for_action("app.open_shortcuts", KEY_COMBINATION_SHOW_KEYBOARD_SHORTCUTS); SimpleAction accept_call_action = new SimpleAction("accept-call", new VariantType.tuple(new VariantType[]{VariantType.INT32, VariantType.INT32})); accept_call_action.activate.connect((variant) => {