Add a keyboard shortcut to show keyboard shortcuts (#1432)

Add a keyboard shortcut to show keyboard shortcuts

    - It's Ctrl+?
This commit is contained in:
eerielili 2023-06-25 11:39:07 +00:00 committed by GitHub
parent 4bb0c465fc
commit da7be50f05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -20,6 +20,12 @@
<property name="title" translatable="yes">Join Channel</property> <property name="title" translatable="yes">Join Channel</property>
</object> </object>
</child> </child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;ctrl&gt;question</property>
<property name="title" translatable="yes">Keyboard shortcuts</property>
</object>
</child>
</object> </object>
</child> </child>
<child> <child>

View file

@ -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_ADD_CONFERENCE = {"<Ctrl>G", null};
private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS = {"<Ctrl>Tab", 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_LOOP_CONVERSATIONS_REV = {"<Ctrl><Shift>Tab", null};
private const string[] KEY_COMBINATION_SHOW_KEYBOARD_SHORTCUTS = {"<Ctrl>question", null};
private MainWindow window; private MainWindow window;
public MainWindowController controller; public MainWindowController controller;
@ -206,6 +207,7 @@ public class Dino.Ui.Application : Adw.Application, Dino.Application {
dialog.present(); dialog.present();
}); });
add_action(open_shortcuts_action); 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})); SimpleAction accept_call_action = new SimpleAction("accept-call", new VariantType.tuple(new VariantType[]{VariantType.INT32, VariantType.INT32}));
accept_call_action.activate.connect((variant) => { accept_call_action.activate.connect((variant) => {