Port to AdwShortcutsDialog

This commit is contained in:
Urtsi Santsi
2025-07-03 16:40:08 +03:00
parent b99887054f
commit be6bc9b431
7 changed files with 125 additions and 129 deletions

View File

@@ -1,7 +1,7 @@
{
"id": "io.github.flattool.Warehouse",
"runtime": "org.gnome.Platform",
"runtime-version": "48",
"runtime-version": "49",
"sdk": "org.gnome.Sdk",
"command": "warehouse",
"finish-args": [
@@ -34,7 +34,7 @@
{
"type": "git",
"url": "https://gitlab.gnome.org/jwestman/blueprint-compiler",
"tag": "v0.16.0"
"tag": "v0.18.0"
}
],
"cleanup": ["*"]

View File

@@ -8,7 +8,7 @@ src/gtk/app_row.blp
src/gtk/attempt_install_dialog.blp
src/gtk/attempt_install_dialog.py
src/gtk/error_toast.py
src/gtk/help-overlay.blp
src/gtk/shortcuts-dialog.blp
src/gtk/installation_chooser.blp
src/gtk/installation_chooser.py
src/gtk/loading_status.blp

View File

@@ -1,123 +0,0 @@
using Gtk 4.0;
ShortcutsWindow help_overlay {
modal: true;
ShortcutsSection {
section-name: "shortcuts";
max-height: 17;
ShortcutsGroup {
title: _("General");
ShortcutsShortcut {
title: _("Refresh");
action-name: "app.refresh";
}
ShortcutsShortcut {
title: _("Open Files");
action-name: "app.open-files";
}
ShortcutsShortcut {
title: _("Open Menu");
action-name: "app.open-menu";
}
ShortcutsShortcut {
title: _("Show Shortcuts");
action-name: "win.show-help-overlay";
}
ShortcutsShortcut {
title: _("Quit");
action-name: "app.quit";
}
}
ShortcutsGroup {
title: _("Navigation");
ShortcutsShortcut {
title: _("Show Packages Page");
action-name: "app.show-packages-page";
}
ShortcutsShortcut {
title: _("Show Remotes Page");
action-name: "app.show-remotes-page";
}
ShortcutsShortcut {
title: _("Show User Data Page");
action-name: "app.show-user-data-page";
}
ShortcutsShortcut {
title: _("Show Snapshots Page");
action-name: "app.show-snapshots-page";
}
ShortcutsShortcut {
title: _("Show Install Page");
action-name: "app.show-install-page";
}
}
ShortcutsGroup {
title: _("Packages Page");
ShortcutsShortcut {
title: _("Search Mode");
action-name: "app.search-mode";
}
ShortcutsShortcut {
title: _("Edit Filters");
action-name: "app.filter";
}
ShortcutsShortcut {
title: _("Selection Mode");
action-name: "app.toggle-select-mode";
}
}
ShortcutsGroup {
title: _("Remotes Page");
ShortcutsShortcut {
title: _("Search Mode");
action-name: "app.search-mode";
}
ShortcutsShortcut {
title: _("Show or Hide Disabled Remotes");
action-name: "app.filter";
}
ShortcutsShortcut {
title: _("New Remote");
action-name: "app.new";
}
}
ShortcutsGroup {
title: _("User Data Page");
ShortcutsShortcut {
title: _("Search Mode");
action-name: "app.search-mode";
}
ShortcutsShortcut {
title: _("Edit Sorting Modes");
action-name: "app.filter";
}
ShortcutsShortcut {
title: _("Selection Mode");
action-name: "app.toggle-select-mode";
}
ShortcutsShortcut {
title: _("Show Active Data");
action-name: "app.active-data-view";
}
ShortcutsShortcut {
title: _("Show Leftover Data");
action-name: "app.leftover-data-view";
}
}
ShortcutsGroup {
title: _("Snapshots Page");
ShortcutsShortcut {
title: _("Search Mode");
action-name: "app.search-mode";
}
ShortcutsShortcut {
title: _("Selection Mode");
action-name: "app.toggle-select-mode";
}
ShortcutsShortcut {
title: _("New Snapshots");
action-name: "app.new";
}
}
}
}

View File

@@ -0,0 +1,119 @@
using Gtk 4.0;
using Adw 1;
Adw.ShortcutsDialog shortcuts_dialog {
Adw.ShortcutsSection {
title: _("General");
Adw.ShortcutsItem {
title: _("Refresh");
action-name: "app.refresh";
}
Adw.ShortcutsItem {
title: _("Open Files");
action-name: "app.open-files";
}
Adw.ShortcutsItem {
title: _("Open Menu");
action-name: "app.open-menu";
}
Adw.ShortcutsItem {
title: _("Show Shortcuts");
action-name: "app.shortcuts";
}
Adw.ShortcutsItem {
title: _("Quit");
action-name: "app.quit";
}
}
Adw.ShortcutsSection {
title: _("Navigation");
Adw.ShortcutsItem {
title: _("Show Packages Page");
action-name: "app.show-packages-page";
}
Adw.ShortcutsItem {
title: _("Show Remotes Page");
action-name: "app.show-remotes-page";
}
Adw.ShortcutsItem {
title: _("Show User Data Page");
action-name: "app.show-user-data-page";
}
Adw.ShortcutsItem {
title: _("Show Snapshots Page");
action-name: "app.show-snapshots-page";
}
Adw.ShortcutsItem {
title: _("Show Install Page");
action-name: "app.show-install-page";
}
}
Adw.ShortcutsSection {
title: _("Packages Page");
Adw.ShortcutsItem {
title: _("Search Mode");
action-name: "app.search-mode";
}
Adw.ShortcutsItem {
title: _("Edit Filters");
action-name: "app.filter";
}
Adw.ShortcutsItem {
title: _("Selection Mode");
action-name: "app.toggle-select-mode";
}
}
Adw.ShortcutsSection {
title: _("Remotes Page");
Adw.ShortcutsItem {
title: _("Search Mode");
action-name: "app.search-mode";
}
Adw.ShortcutsItem {
title: _("Show or Hide Disabled Remotes");
action-name: "app.filter";
}
Adw.ShortcutsItem {
title: _("New Remote");
action-name: "app.new";
}
}
Adw.ShortcutsSection {
title: _("User Data Page");
Adw.ShortcutsItem {
title: _("Search Mode");
action-name: "app.search-mode";
}
Adw.ShortcutsItem {
title: _("Edit Sorting Modes");
action-name: "app.filter";
}
Adw.ShortcutsItem {
title: _("Selection Mode");
action-name: "app.toggle-select-mode";
}
Adw.ShortcutsItem {
title: _("Show Active Data");
action-name: "app.active-data-view";
}
Adw.ShortcutsItem {
title: _("Show Leftover Data");
action-name: "app.leftover-data-view";
}
}
Adw.ShortcutsSection {
title: _("Snapshots Page");
Adw.ShortcutsItem {
title: _("Search Mode");
action-name: "app.search-mode";
}
Adw.ShortcutsItem {
title: _("Selection Mode");
action-name: "app.toggle-select-mode";
}
Adw.ShortcutsItem {
title: _("New Snapshots");
action-name: "app.new";
}
}
}

View File

@@ -163,7 +163,7 @@ menu primary_menu {
}
item {
label: _("_Keyboard Shortcuts");
action: "win.show-help-overlay";
action: "app.shortcuts";
}
item {
label: _("_About Warehouse");

View File

@@ -5,7 +5,7 @@ gnome = import('gnome')
blueprints = custom_target('blueprints',
input: files(
'gtk/app_row.blp',
'gtk/help-overlay.blp',
'gtk/shortcuts-dialog.blp',
'gtk/loading_status.blp',
'gtk/installation_chooser.blp',
'gtk/attempt_install_dialog.blp',

View File

@@ -2,7 +2,7 @@
<gresources>
<gresource prefix="/io/github/flattool/Warehouse">
<file alias="style.css">../data/style.css</file>
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file preprocess="xml-stripblanks" alias="shortcuts-dialog.ui">gtk/shortcuts-dialog.ui</file>
<file preprocess="xml-stripblanks">gtk/loading_status.ui</file>
<file preprocess="xml-stripblanks">gtk/app_row.ui</file>
<file preprocess="xml-stripblanks">gtk/installation_chooser.ui</file>