Add a standard AdwAboutDialog wired to app metadata, plus the AppStream metainfo file it should share data with. Use when adding an About entry, release notes, credits, or preparing app metadata.
中文简介正在准备中。当前显示原文说明。
Add a Keyboard Shortcuts help window (Ctrl+question) listing all app accelerators, plus the standard GNOME accelerator set. Use when wiring keyboard shortcuts or the Keyboard Shortcuts menu item.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
The "Keyboard Shortcuts" item in the primary menu (accelerator
Ctrl+? / <primary>question) opens a searchable shortcuts overview.
using Gtk 4.0;
using Adw 1;
Adw.ShortcutsDialog shortcuts_dialog {
Adw.ShortcutsSection {
title: _("General");
Adw.ShortcutsItem { title: _("Show Shortcuts"); accelerator: "<primary>question"; }
Adw.ShortcutsItem { title: _("Preferences"); accelerator: "<primary>comma"; }
Adw.ShortcutsItem { title: _("Quit"); accelerator: "<primary>q"; }
}
Adw.ShortcutsSection {
title: _("Documents");
Adw.ShortcutsItem { title: _("New Document"); accelerator: "<primary>n"; }
Adw.ShortcutsItem { title: _("Save"); accelerator: "<primary>s"; }
}
}
Older libadwaita: use Gtk.ShortcutsWindow (same structure with
GtkShortcutsSection/Group/Shortcut; note it is deprecated in GTK 4.18+).
self.create_action('shortcuts', self._on_shortcuts, ['<primary>question'])
def _on_shortcuts(self, action, param):
builder = Gtk.Builder.new_from_resource('/org/example/MyApp/shortcuts.ui')
builder.get_object('shortcuts_dialog').present(self.props.active_window)
| Accelerator | Action | Accelerator | Action | |
|---|---|---|---|---|
<primary>n | New window/doc | <primary>f | Find | |
<primary>o | Open | <primary>h | Find and replace | |
<primary>s | Save | <primary>z / <primary><shift>z | Undo / Redo | |
<primary><shift>s | Save as | <primary>x/c/v | Cut/Copy/Paste | |
<primary>p | <primary>a | Select all | ||
<primary>w | Close tab/window | <primary>plus/minus/0 | Zoom in/out/reset | |
<primary>q | Quit | F1 | Help | |
<primary>comma | Preferences | F9 | Toggle sidebar | |
<primary>question | Shortcuts | F10 | Open primary menu | |
<primary>t | New tab | F11 | Fullscreen | |
<primary>Page_Down/Page_Up | Next/previous tab | Escape | Cancel/close |
Rules:
use-underline: true + _ in labels.Full table: reference/hig/keyboard.md.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Add a standard AdwAboutDialog wired to app metadata, plus the AppStream metainfo file it should share data with. Use when adding an About entry, release notes, credits, or preparing app metadata.
中文简介正在准备中。当前显示原文说明。
Make a GTK4/libadwaita app accessible — accessible labels and roles, tooltips on icon-only buttons, keyboard navigation, contrast, and testing with Orca/Accerciser. Use when fixing a11y issues or running the accessibility category of a HIG audit.
中文简介正在准备中。当前显示原文说明。
Responsive GNOME layouts: AdwBreakpoint conditions, BreakpointBin, MultiLayoutView, BottomSheet, narrow/wide layout swaps. Use when making an app work on phones or narrow windows.
中文简介正在准备中。当前显示原文说明。
Onboarding tour with AdwCarousel and navigation dots, skippable welcome screens. Use when adding a first-run tour or feature showcase to a GNOME app.
中文简介正在准备中。当前显示原文说明。
Implement GNOME's 4-tier destructive-action pattern: undo toasts instead of confirmation dialogs, AdwAlertDialog for irreversible actions. Use when adding delete, remove, clear, or other destructive actions.
中文简介正在准备中。当前显示原文说明。
Loading, empty, and error states with AdwStatusPage and AdwSpinner — placeholder icons, titles, action buttons. Use when an app view can be empty, loading, or failed.
中文简介正在准备中。当前显示原文说明。