shortcuts-dialog: Add initial shortcuts

This commit is contained in:
Jamie Gravendeel
2025-12-03 17:29:53 +01:00
parent 76a74501ad
commit 07640a5186
4 changed files with 56 additions and 1 deletions

View File

@@ -10,7 +10,13 @@ python.install_sources(
)
blueprints = custom_target(
input: files('cover.blp', 'game-details.blp', 'game-item.blp', 'window.blp'),
input: files(
'cover.blp',
'game-details.blp',
'game-item.blp',
'shortcuts-dialog.blp',
'window.blp',
),
output: '.',
command: [
blueprint_compiler,

View File

@@ -0,0 +1,47 @@
using Gtk 4.0;
using Adw 1;
Adw.ShortcutsDialog shortcuts_dialog {
Adw.ShortcutsSection {
title: _("General");
Adw.ShortcutsItem {
title: _("Search");
accelerator: "<Control>f";
}
Adw.ShortcutsItem {
title: _("Main Menu");
accelerator: "F10";
}
Adw.ShortcutsItem {
title: _("Keyboard Shortcuts");
action-name: "app.shortcuts";
}
Adw.ShortcutsItem {
title: _("Quit");
action-name: "app.quit";
}
}
Adw.ShortcutsSection {
title: _("Games");
Adw.ShortcutsItem {
title: _("Add Game");
accelerator: "<Control>n";
}
Adw.ShortcutsItem {
title: _("Show Hidden Games");
accelerator: "<Control>h";
}
Adw.ShortcutsItem {
title: _("Remove Game");
accelerator: "Delete";
}
}
}

View File

@@ -4,6 +4,7 @@
<file>cover.ui</file>
<file>game-details.ui</file>
<file>game-item.ui</file>
<file>shortcuts-dialog.ui</file>
<file>window.ui</file>
<file>style.css</file>
</gresource>

View File

@@ -114,6 +114,7 @@ template $Window: Adw.ApplicationWindow {
primary: true;
menu-model: menu {
item (_("Keyboard Shortcuts"), "app.shortcuts")
item (_("About Cartridges"), "app.about")
};
}