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 standard GNOME preferences dialog (AdwPreferencesDialog) with Ctrl+comma shortcut, PreferencesPage/Group rows, and GSettings bindings. Use when adding settings or preferences UI to a GNOME app.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Add a standard GNOME preferences dialog accessible via Ctrl+comma.
Adw.PreferencesDialog {
search-enabled: true;
content-width: 600;
Adw.PreferencesPage {
Adw.PreferencesGroup {
title: _("Appearance");
description: _("These settings control how the app looks.");
Adw.SwitchRow {
title: _("_Dark Mode");
use-underline: true;
}
Adw.ComboRow {
title: _("_Theme");
use-underline: true;
model: StringList { strings [_("Light"), _("Dark"), _("System")] };
}
}
Adw.PreferencesGroup {
title: _("Behavior");
Adw.SpinRow {
title: _("_Font Size");
use-underline: true;
numeric: true;
adjustment: Adjustment { lower: 8; upper: 32; step-increment: 1; };
}
}
Adw.PreferencesGroup {
Adw.ButtonRow {
title: _("_Clear History");
use-underline: true;
styles ["destructive-action"];
activated => $on_clear_history_cb(template);
}
}
}
}
<schemalist>
<schema id="org.example.MyApp" path="/org/example/MyApp/">
<key name="dark-mode" type="b"><default>false</default><summary>Dark mode</summary></key>
<key name="font-size" type="i"><default>12</default><summary>Font size</summary></key>
</schema>
</schemalist>
<menu id="primary_menu">
<section>
<item>
<attribute name="label" translatable="yes">P_references</attribute>
<attribute name="action">win.show-preferences</attribute>
<attribute name="accel"><control>comma</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">app.shortcuts</attribute>
</item>
</section>
</menu>
from gi.repository import Adw, Gio
class MyApp(Adw.Application):
def __init__(self):
super().__init__(application_id='org.example.MyApp')
self.create_action('shortcuts', self._on_shortcuts)
class MyWindow(Adw.ApplicationWindow):
def __init__(self, **kwargs):
super().__init__(**kwargs)
show_prefs = Gio.SimpleAction.new('show-preferences', None)
show_prefs.connect('activate', self._on_preferences)
self.add_action(show_prefs)
def _on_preferences(self, action, param):
builder = Gtk.Builder.new_from_resource('/org/example/MyApp/preferences.ui')
dialog = builder.get_object('preferences_dialog')
dialog.present(self)
GSettings *settings = g_settings_new ("org.example.MyApp");
g_settings_bind (settings, "dark-mode", switch, "active", G_SETTINGS_BIND_DEFAULT);
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
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.
日本語の概要は準備中です。原文の説明を表示しています。