Skip to content

Commit

Permalink
Add ShortcutsWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberphantom52 committed Jun 24, 2023
1 parent 4f9609d commit 8b6c6e3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bottles/frontend/ui/bottles.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<file>dialog-vmtouch.ui</file>
<file>onboard.ui</file>
<file>about.ui</file>

<file alias="gtk/help-overlay.ui">help-overlay.ui</file>
</gresource>
<gresource prefix="/com/usebottles/bottles/icons/scalable/actions">
<file alias="bottles-steam-symbolic.svg">../../../data/icons/symbolic/scalable/apps/bottles-steam-symbolic.svg</file>
Expand Down
29 changes: 29 additions & 0 deletions bottles/frontend/ui/help-overlay.blp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Gtk 4.0;

ShortcutsWindow help_overlay {
modal: true;

ShortcutsSection {
section-name: "shortcuts";
max-height: 10;

ShortcutsGroup {
title: C_("shortcut window", "General");

ShortcutsShortcut {
title: C_("shortcut window", "Show Shortcuts");
action-name: "win.show-help-overlay";
}

ShortcutsShortcut {
title: C_("shortcut window", "Quit");
action-name: "app.quit";
}

ShortcutsShortcut {
title: C_("shortcut window", "New Bottle");
action-name: "app.new";
}
}
}
}
1 change: 1 addition & 0 deletions bottles/frontend/ui/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ blueprints = custom_target('blueprints',
'task-entry.blp',
'window.blp',
'details-preferences.blp',
'help-overlay.blp',
),
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],)
Expand Down
5 changes: 5 additions & 0 deletions bottles/frontend/ui/window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ menu primary_menu {
action: "app.help";
}

item {
label: _("_Keyboard Shortcuts");
action: "win.show-help-overlay";
}

item {
label: _("About Bottles");
action: "app.about";
Expand Down

0 comments on commit 8b6c6e3

Please sign in to comment.