[libadwaita] demo: Add toast demo
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita] demo: Add toast demo
- Date: Sat, 6 Nov 2021 17:20:18 +0000 (UTC)
commit 762833862034968f7ab7633a38a1cf1a4542272e
Author: Maximiliano Sandoval R <msandova gnome org>
Date: Sat Nov 6 22:10:34 2021 +0500
demo: Add toast demo
Co-authored-by: Alexander Mikhaylenko <alexm gnome org>
demo/adw-demo-window.c | 93 +++
demo/adw-demo-window.ui | 1521 +++++++++++++++++++++++++----------------------
2 files changed, 890 insertions(+), 724 deletions(-)
---
diff --git a/demo/adw-demo-window.c b/demo/adw-demo-window.c
index 1337d26c..e1542a3f 100644
--- a/demo/adw-demo-window.c
+++ b/demo/adw-demo-window.c
@@ -11,6 +11,7 @@ struct _AdwDemoWindow
AdwApplicationWindow parent_instance;
AdwLeaflet *content_box;
+ AdwToastOverlay *toast_overlay;
GtkBox *right_box;
GtkWidget *color_scheme_button;
GtkStackSidebar *sidebar;
@@ -26,6 +27,8 @@ struct _AdwDemoWindow
GtkButton *avatar_remove_button;
GtkFileChooserNative *avatar_file_chooser;
GtkListBox *avatar_contacts;
+ int toast_undo_items;
+ AdwToast *undo_toast;
};
G_DEFINE_TYPE (AdwDemoWindow, adw_demo_window, ADW_TYPE_APPLICATION_WINDOW)
@@ -398,6 +401,87 @@ style_classes_demo_clicked_cb (GtkButton *btn,
gtk_window_present (GTK_WINDOW (window));
}
+static void
+add_toast_cb (AdwDemoWindow *self)
+{
+ adw_toast_overlay_add_toast (self->toast_overlay,
+ adw_toast_new (_("Simple toast")));
+}
+
+static void
+dismissed_cb (AdwDemoWindow *self)
+{
+ self->undo_toast = NULL;
+ self->toast_undo_items = 0;
+
+ gtk_widget_action_set_enabled (GTK_WIDGET (self), "toast.dismiss", FALSE);
+}
+
+static void
+add_toast_with_button_cb (AdwDemoWindow *self)
+{
+ g_autofree char *title = NULL;
+
+ self->toast_undo_items++;
+
+ if (!self->undo_toast) {
+ title = g_strdup_printf (_("‘%s’ deleted"), "Lorem ipsum");
+
+ self->undo_toast = adw_toast_new (title);
+
+ adw_toast_set_priority (self->undo_toast, ADW_TOAST_PRIORITY_HIGH);
+ adw_toast_set_button_label (self->undo_toast, _("Undo"));
+ adw_toast_set_action_name (self->undo_toast, "toast.undo");
+
+ g_signal_connect_swapped (self->undo_toast, "dismissed", G_CALLBACK (dismissed_cb), self);
+
+ adw_toast_overlay_add_toast (self->toast_overlay, self->undo_toast);
+
+ gtk_widget_action_set_enabled (GTK_WIDGET (self), "toast.dismiss", TRUE);
+
+ return;
+ }
+
+ title =
+ g_strdup_printf (ngettext ("<span font_features='tnum=1'>%d</span> item deleted",
+ "<span font_features='tnum=1'>%d</span> items deleted",
+ self->toast_undo_items), self->toast_undo_items);
+
+ adw_toast_set_title (self->undo_toast, title);
+}
+
+static void
+add_toast_with_long_title_cb (AdwDemoWindow *self)
+{
+ adw_toast_overlay_add_toast (self->toast_overlay,
+ adw_toast_new (_("Lorem ipsum dolor sit amet, "
+ "consectetur adipiscing elit, "
+ "sed do eiusmod tempor incididunt "
+ "ut labore et dolore magnam aliquam "
+ "quaerat voluptatem.")));
+}
+
+static void
+toast_undo_cb (AdwDemoWindow *self)
+{
+ g_autofree char *title =
+ g_strdup_printf (ngettext ("Undoing deleting <span font_features='tnum=1'>%d</span> item…",
+ "Undoing deleting <span font_features='tnum=1'>%d</span> items…",
+ self->toast_undo_items), self->toast_undo_items);
+ AdwToast *toast = adw_toast_new (title);
+
+ adw_toast_set_priority (toast, ADW_TOAST_PRIORITY_HIGH);
+
+ adw_toast_overlay_add_toast (self->toast_overlay, toast);
+}
+
+static void
+toast_dismiss_cb (AdwDemoWindow *self)
+{
+ if (self->undo_toast)
+ adw_toast_dismiss (self->undo_toast);
+}
+
static void
adw_demo_window_class_init (AdwDemoWindowClass *klass)
{
@@ -405,6 +489,9 @@ adw_demo_window_class_init (AdwDemoWindowClass *klass)
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_q, GDK_CONTROL_MASK, "window.close", NULL);
+ gtk_widget_class_install_action (widget_class, "toast.undo", NULL, (GtkWidgetActionActivateFunc)
toast_undo_cb);
+ gtk_widget_class_install_action (widget_class, "toast.dismiss", NULL, (GtkWidgetActionActivateFunc)
toast_dismiss_cb);
+
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Adwaita1/Demo/ui/adw-demo-window.ui");
gtk_widget_class_bind_template_child (widget_class, AdwDemoWindow, content_box);
gtk_widget_class_bind_template_child (widget_class, AdwDemoWindow, right_box);
@@ -421,6 +508,7 @@ adw_demo_window_class_init (AdwDemoWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, AdwDemoWindow, avatar_file_chooser_label);
gtk_widget_class_bind_template_child (widget_class, AdwDemoWindow, avatar_remove_button);
gtk_widget_class_bind_template_child (widget_class, AdwDemoWindow, avatar_contacts);
+ gtk_widget_class_bind_template_child (widget_class, AdwDemoWindow, toast_overlay);
gtk_widget_class_bind_template_callback (widget_class, notify_visible_child_cb);
gtk_widget_class_bind_template_callback (widget_class, back_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, leaflet_back_clicked_cb);
@@ -441,6 +529,9 @@ adw_demo_window_class_init (AdwDemoWindowClass *klass)
gtk_widget_class_bind_template_callback (widget_class, flap_demo_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, tab_view_demo_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, style_classes_demo_clicked_cb);
+ gtk_widget_class_bind_template_callback (widget_class, add_toast_cb);
+ gtk_widget_class_bind_template_callback (widget_class, add_toast_with_button_cb);
+ gtk_widget_class_bind_template_callback (widget_class, add_toast_with_long_title_cb);
}
static void
@@ -485,4 +576,6 @@ adw_demo_window_init (AdwDemoWindow *self)
avatar_page_init (self);
adw_leaflet_set_visible_child (self->content_box, GTK_WIDGET (self->right_box));
+
+ gtk_widget_action_set_enabled (GTK_WIDGET (self), "toast.dismiss", FALSE);
}
diff --git a/demo/adw-demo-window.ui b/demo/adw-demo-window.ui
index ebd0b867..aba5a73e 100644
--- a/demo/adw-demo-window.ui
+++ b/demo/adw-demo-window.ui
@@ -39,944 +39,1017 @@
<property name="default_width">800</property>
<property name="default_height">576</property>
<child>
- <object class="AdwLeaflet" id="subpage_leaflet">
- <property name="can-swipe-back">True</property>
- <property name="width-request">360</property>
- <property name="can-unfold">False</property>
- <property name="transition-type" bind-source="content_box" bind-property="transition-type"
bind-flags="sync-create"/>
- <child>
- <object class="AdwLeaflet" id="content_box">
+ <object class="AdwToastOverlay" id="toast_overlay">
+ <property name="child">
+ <object class="AdwLeaflet" id="subpage_leaflet">
<property name="can-swipe-back">True</property>
+ <property name="width-request">360</property>
+ <property name="can-unfold">False</property>
+ <property name="transition-type" bind-source="content_box" bind-property="transition-type"
bind-flags="sync-create"/>
<child>
- <object class="GtkBox">
- <property name="orientation">vertical</property>
+ <object class="AdwLeaflet" id="content_box">
+ <property name="can-swipe-back">True</property>
<child>
- <object class="AdwHeaderBar">
- <property name="show-end-title-buttons" bind-source="content_box" bind-property="folded"
bind-flags="sync-create"/>
- <child type="start">
- <object class="GtkButton" id="color_scheme_button">
- <binding name="icon-name">
- <closure type="gchararray" function="get_color_scheme_icon_name">
- <lookup name="dark" type="AdwStyleManager">
- <lookup name="style-manager" type="AdwApplication">
- <lookup name="application">AdwDemoWindow</lookup>
- </lookup>
- </lookup>
- </closure>
- </binding>
- <signal name="clicked" handler="color_scheme_button_clicked_cb" swapped="yes"/>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="AdwHeaderBar">
+ <property name="show-end-title-buttons" bind-source="content_box"
bind-property="folded" bind-flags="sync-create"/>
+ <child type="start">
+ <object class="GtkButton" id="color_scheme_button">
+ <binding name="icon-name">
+ <closure type="gchararray" function="get_color_scheme_icon_name">
+ <lookup name="dark" type="AdwStyleManager">
+ <lookup name="style-manager" type="AdwApplication">
+ <lookup name="application">AdwDemoWindow</lookup>
+ </lookup>
+ </lookup>
+ </closure>
+ </binding>
+ <signal name="clicked" handler="color_scheme_button_clicked_cb" swapped="yes"/>
+ </object>
+ </child>
+ <child type="end">
+ <object class="GtkMenuButton" id="menu_button">
+ <property name="menu-model">primary_menu</property>
+ <property name="icon-name">open-menu-symbolic</property>
+ </object>
+ </child>
</object>
</child>
- <child type="end">
- <object class="GtkMenuButton" id="menu_button">
- <property name="menu-model">primary_menu</property>
- <property name="icon-name">open-menu-symbolic</property>
+ <child>
+ <object class="GtkStackSidebar" id="sidebar">
+ <property name="width_request">270</property>
+ <property name="vexpand">True</property>
+ <property name="stack">stack</property>
</object>
</child>
</object>
</child>
<child>
- <object class="GtkStackSidebar" id="sidebar">
- <property name="width_request">270</property>
- <property name="vexpand">True</property>
- <property name="stack">stack</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="AdwLeafletPage">
- <property name="navigatable">False</property>
- <property name="child">
- <object class="GtkSeparator"/>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkBox" id="right_box">
- <property name="orientation">vertical</property>
- <property name="hexpand">True</property>
- <child>
- <object class="AdwHeaderBar">
- <property name="show-start-title-buttons" bind-source="content_box"
bind-property="folded" bind-flags="sync-create"/>
- <property name="title-widget">
- <object class="GtkBox"/>
+ <object class="AdwLeafletPage">
+ <property name="navigatable">False</property>
+ <property name="child">
+ <object class="GtkSeparator"/>
</property>
- <child type="start">
- <object class="GtkButton" id="back">
- <property name="valign">center</property>
- <property name="tooltip-text" translatable="yes">Back</property>
- <property name="icon-name">go-previous-symbolic</property>
- <property name="visible" bind-source="content_box" bind-property="folded"
bind-flags="sync-create"/>
- <signal name="clicked" handler="back_clicked_cb"/>
- </object>
- </child>
</object>
</child>
<child>
- <object class="GtkStack" id="stack">
- <property name="vexpand">True</property>
- <property name="vhomogeneous">False</property>
- <signal name="notify::visible-child" handler="notify_visible_child_cb" after="yes"
swapped="no"/>
+ <object class="GtkBox" id="right_box">
+ <property name="orientation">vertical</property>
+ <property name="hexpand">True</property>
<child>
- <object class="GtkStackPage">
- <property name="name">welcome</property>
- <property name="title" translatable="yes">Welcome</property>
- <property name="child">
- <object class="AdwStatusPage">
- <property name="icon-name">org.gnome.Adwaita1.Demo-symbolic</property>
- <property name="title" translatable="yes">Welcome to Adwaita Demo</property>
- <property name="description" translatable="yes">This is a tour of the features
the library has to offer.</property>
- </object>
+ <object class="AdwHeaderBar">
+ <property name="show-start-title-buttons" bind-source="content_box"
bind-property="folded" bind-flags="sync-create"/>
+ <property name="title-widget">
+ <object class="GtkBox"/>
</property>
+ <child type="start">
+ <object class="GtkButton" id="back">
+ <property name="valign">center</property>
+ <property name="tooltip-text" translatable="yes">Back</property>
+ <property name="icon-name">go-previous-symbolic</property>
+ <property name="visible" bind-source="content_box" bind-property="folded"
bind-flags="sync-create"/>
+ <signal name="clicked" handler="back_clicked_cb"/>
+ </object>
+ </child>
</object>
</child>
<child>
- <object class="GtkStackPage">
- <property name="name">leaflet</property>
- <property name="title" translatable="yes">Leaflet</property>
- <property name="child">
- <object class="AdwStatusPage">
- <property name="icon-name">widget-leaflet-symbolic</property>
- <property name="title" translatable="yes">Leaflet</property>
- <property name="description" translatable="yes">A widget showing either all its
children or only one, depending on the available space. This window is using a leaflet, you can control it
with the settings below.</property>
+ <object class="GtkStack" id="stack">
+ <property name="vexpand">True</property>
+ <property name="vhomogeneous">False</property>
+ <signal name="notify::visible-child" handler="notify_visible_child_cb" after="yes"
swapped="no"/>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">welcome</property>
+ <property name="title" translatable="yes">Welcome</property>
<property name="child">
- <object class="AdwClamp">
- <property name="child">
- <object class="AdwPreferencesGroup">
- <child>
- <object class="AdwComboRow" id="leaflet_transition_row">
- <property name="subtitle" translatable="yes">The type of transition
to use when the leaflet adapts its size or when changing the visible child</property>
- <property name="title" translatable="yes">Transition type</property>
- <signal name="notify::selected"
handler="notify_leaflet_transition_cb" swapped="no"/>
- <property name="model">
- <object class="AdwEnumListModel">
- <property name="enum-type">AdwLeafletTransitionType</property>
- </object>
- </property>
- <property name="expression">
- <closure type="gchararray" function="leaflet_transition_name"/>
- </property>
- </object>
- </child>
- <child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Go to the next page of the
leaflet</property>
- <property name="use_underline">True</property>
- <property name="activatable">True</property>
- <signal name="activated" handler="leaflet_go_next_row_activated_cb"
swapped="yes"/>
- <child>
- <object class="GtkImage">
- <property name="icon_name">go-next-symbolic</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- </property>
+ <object class="AdwStatusPage">
+ <property name="icon-name">org.gnome.Adwaita1.Demo-symbolic</property>
+ <property name="title" translatable="yes">Welcome to Adwaita Demo</property>
+ <property name="description" translatable="yes">This is a tour of the
features the library has to offer.</property>
</object>
</property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">clamp</property>
- <property name="title" translatable="yes">Clamp</property>
- <property name="child">
- <object class="AdwStatusPage">
- <property name="icon-name">widget-clamp-symbolic</property>
- <property name="title" translatable="yes">Clamp</property>
- <property name="description" translatable="yes">This page is clamped to smoothly
grow up to a maximum width.</property>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">leaflet</property>
+ <property name="title" translatable="yes">Leaflet</property>
<property name="child">
- <object class="AdwClamp">
- <property name="maximum-size" bind-source="clamp_maximum_size_adjustment"
bind-property="value" bind-flags="sync-create"/>
- <property name="tightening-threshold"
bind-source="clamp_tightening_threshold_adjustment" bind-property="value" bind-flags="sync-create"/>
+ <object class="AdwStatusPage">
+ <property name="icon-name">widget-leaflet-symbolic</property>
+ <property name="title" translatable="yes">Leaflet</property>
+ <property name="description" translatable="yes">A widget showing either all
its children or only one, depending on the available space. This window is using a leaflet, you can control
it with the settings below.</property>
<property name="child">
- <object class="AdwPreferencesGroup">
- <child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Maximum width</property>
+ <object class="AdwClamp">
+ <property name="child">
+ <object class="AdwPreferencesGroup">
<child>
- <object class="GtkSpinButton">
- <property
name="adjustment">clamp_maximum_size_adjustment</property>
- <property name="valign">center</property>
+ <object class="AdwComboRow" id="leaflet_transition_row">
+ <property name="subtitle" translatable="yes">The type of
transition to use when the leaflet adapts its size or when changing the visible child</property>
+ <property name="title" translatable="yes">Transition
type</property>
+ <signal name="notify::selected"
handler="notify_leaflet_transition_cb" swapped="no"/>
+ <property name="model">
+ <object class="AdwEnumListModel">
+ <property
name="enum-type">AdwLeafletTransitionType</property>
+ </object>
+ </property>
+ <property name="expression">
+ <closure type="gchararray" function="leaflet_transition_name"/>
+ </property>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Tightening
threshold</property>
<child>
- <object class="GtkSpinButton">
- <property
name="adjustment">clamp_tightening_threshold_adjustment</property>
- <property name="valign">center</property>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Go to the next page of
the leaflet</property>
+ <property name="use_underline">True</property>
+ <property name="activatable">True</property>
+ <signal name="activated"
handler="leaflet_go_next_row_activated_cb" swapped="yes"/>
+ <child>
+ <object class="GtkImage">
+ <property name="icon_name">go-next-symbolic</property>
+ </object>
+ </child>
</object>
</child>
</object>
- </child>
+ </property>
</object>
</property>
</object>
</property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">lists</property>
- <property name="title" translatable="yes">Lists</property>
- <property name="child">
- <object class="AdwStatusPage">
- <property name="icon-name">widget-list-symbolic</property>
- <property name="title" translatable="yes">Lists</property>
- <property name="description" translatable="yes">Rows and helpers for
GtkListBox.</property>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">clamp</property>
+ <property name="title" translatable="yes">Clamp</property>
<property name="child">
- <object class="AdwClamp">
- <property name="maximum-size">400</property>
- <property name="tightening-threshold">300</property>
+ <object class="AdwStatusPage">
+ <property name="icon-name">widget-clamp-symbolic</property>
+ <property name="title" translatable="yes">Clamp</property>
+ <property name="description" translatable="yes">This page is clamped to
smoothly grow up to a maximum width.</property>
<property name="child">
- <object class="GtkBox">
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
- <child>
+ <object class="AdwClamp">
+ <property name="maximum-size"
bind-source="clamp_maximum_size_adjustment" bind-property="value" bind-flags="sync-create"/>
+ <property name="tightening-threshold"
bind-source="clamp_tightening_threshold_adjustment" bind-property="value" bind-flags="sync-create"/>
+ <property name="child">
<object class="AdwPreferencesGroup">
<child>
<object class="AdwActionRow">
- <property name="icon-name">row-preferences-symbolic</property>
- <property name="subtitle" translatable="yes">They also have a
subtitle and an icon</property>
- <property name="title" translatable="yes">Rows have a
title</property>
- </object>
- </child>
- <child>
- <object class="AdwActionRow">
- <property name="activatable_widget">frobnicate</property>
- <property name="title" translatable="yes">Rows can have suffix
widgets</property>
+ <property name="title" translatable="yes">Maximum
width</property>
<child>
- <object class="GtkButton" id="frobnicate">
- <property name="halign">end</property>
- <property name="label"
translatable="yes">Frobnicate</property>
- <property name="valign">center</property>
- <style>
- <class name="outline"/>
- </style>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="AdwPreferencesGroup">
- <child>
- <object class="AdwActionRow">
- <property name="activatable_widget">radio_button_1</property>
- <property name="title" translatable="yes">Rows can have prefix
widgets</property>
- <child type="prefix">
- <object class="GtkCheckButton" id="radio_button_1">
+ <object class="GtkSpinButton">
+ <property
name="adjustment">clamp_maximum_size_adjustment</property>
<property name="valign">center</property>
- <property name="active">True</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow">
- <property name="activatable_widget">radio_button_2</property>
- <property name="title" translatable="yes">Rows can have prefix
widgets</property>
- <child type="prefix">
- <object class="GtkCheckButton" id="radio_button_2">
- <property name="group">radio_button_1</property>
+ <property name="title" translatable="yes">Tightening
threshold</property>
+ <child>
+ <object class="GtkSpinButton">
+ <property
name="adjustment">clamp_tightening_threshold_adjustment</property>
<property name="valign">center</property>
</object>
</child>
</object>
</child>
</object>
- </child>
- <child>
- <object class="AdwPreferencesGroup">
- <property name="title" translatable="yes">Combo Rows</property>
+ </property>
+ </object>
+ </property>
+ </object>
+ </property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">lists</property>
+ <property name="title" translatable="yes">Lists</property>
+ <property name="child">
+ <object class="AdwStatusPage">
+ <property name="icon-name">widget-list-symbolic</property>
+ <property name="title" translatable="yes">Lists</property>
+ <property name="description" translatable="yes">Rows and helpers for
GtkListBox.</property>
+ <property name="child">
+ <object class="AdwClamp">
+ <property name="maximum-size">400</property>
+ <property name="tightening-threshold">300</property>
+ <property name="child">
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
<child>
- <object class="AdwComboRow" id="combo_row">
- <property name="title" translatable="yes">Combo row</property>
- <property name="model">
- <object class="GtkStringList">
- <items>
- <item>Foo</item>
- <item>Bar</item>
- <item>Baz</item>
- </items>
+ <object class="AdwPreferencesGroup">
+ <child>
+ <object class="AdwActionRow">
+ <property
name="icon-name">row-preferences-symbolic</property>
+ <property name="subtitle" translatable="yes">They also have
a subtitle and an icon</property>
+ <property name="title" translatable="yes">Rows have a
title</property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="AdwComboRow" id="enum_combo_row">
- <property name="subtitle" translatable="yes">This combo row was
created from an enumeration</property>
- <property name="title" translatable="yes">Enumeration combo
row</property>
- <property name="model">
- <object class="AdwEnumListModel">
- <property name="enum-type">GtkLicense</property>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="activatable_widget">frobnicate</property>
+ <property name="title" translatable="yes">Rows can have
suffix widgets</property>
+ <child>
+ <object class="GtkButton" id="frobnicate">
+ <property name="halign">end</property>
+ <property name="label"
translatable="yes">Frobnicate</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="outline"/>
+ </style>
+ </object>
+ </child>
</object>
- </property>
- <property name="expression">
- <lookup type="AdwEnumListItem" name="nick"/>
- </property>
+ </child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="AdwPreferencesGroup">
- <property name="title" translatable="yes">Expander Rows</property>
<child>
- <object class="AdwExpanderRow" id="expander_row">
- <property name="title" translatable="yes">Expander row</property>
+ <object class="AdwPreferencesGroup">
<child>
<object class="AdwActionRow">
- <property name="title" translatable="yes">A nested
row</property>
+ <property name="activatable_widget">radio_button_1</property>
+ <property name="title" translatable="yes">Rows can have
prefix widgets</property>
+ <child type="prefix">
+ <object class="GtkCheckButton" id="radio_button_1">
+ <property name="valign">center</property>
+ <property name="active">True</property>
+ </object>
+ </child>
</object>
</child>
<child>
<object class="AdwActionRow">
- <property name="title" translatable="yes">Another nested
row</property>
+ <property name="activatable_widget">radio_button_2</property>
+ <property name="title" translatable="yes">Rows can have
prefix widgets</property>
+ <child type="prefix">
+ <object class="GtkCheckButton" id="radio_button_2">
+ <property name="group">radio_button_1</property>
+ <property name="valign">center</property>
+ </object>
+ </child>
</object>
</child>
</object>
</child>
<child>
- <object class="AdwExpanderRow" id="action_expander_row">
- <property name="title" translatable="yes">Expander row with an
action</property>
- <child type="action">
- <object class="GtkButton">
- <property name="valign">center</property>
- <property name="icon-name">row-copy-symbolic</property>
- <style>
- <class name="outline"/>
- </style>
- </object>
- </child>
+ <object class="AdwPreferencesGroup">
+ <property name="title" translatable="yes">Combo Rows</property>
<child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">A nested
row</property>
+ <object class="AdwComboRow" id="combo_row">
+ <property name="title" translatable="yes">Combo
row</property>
+ <property name="model">
+ <object class="GtkStringList">
+ <items>
+ <item>Foo</item>
+ <item>Bar</item>
+ <item>Baz</item>
+ </items>
+ </object>
+ </property>
</object>
</child>
<child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Another nested
row</property>
+ <object class="AdwComboRow" id="enum_combo_row">
+ <property name="subtitle" translatable="yes">This combo row
was created from an enumeration</property>
+ <property name="title" translatable="yes">Enumeration combo
row</property>
+ <property name="model">
+ <object class="AdwEnumListModel">
+ <property name="enum-type">GtkLicense</property>
+ </object>
+ </property>
+ <property name="expression">
+ <lookup type="AdwEnumListItem" name="nick"/>
+ </property>
</object>
</child>
</object>
</child>
<child>
- <object class="AdwExpanderRow" id="enable_expander_row">
- <property name="show_enable_switch">True</property>
- <property name="title" translatable="yes">Toggleable expander
row</property>
+ <object class="AdwPreferencesGroup">
+ <property name="title" translatable="yes">Expander
Rows</property>
<child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">A nested
row</property>
+ <object class="AdwExpanderRow" id="expander_row">
+ <property name="title" translatable="yes">Expander
row</property>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">A nested
row</property>
+ </object>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Another nested
row</property>
+ </object>
+ </child>
</object>
</child>
<child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Another nested
row</property>
+ <object class="AdwExpanderRow" id="action_expander_row">
+ <property name="title" translatable="yes">Expander row with
an action</property>
+ <child type="action">
+ <object class="GtkButton">
+ <property name="valign">center</property>
+ <property name="icon-name">row-copy-symbolic</property>
+ <style>
+ <class name="outline"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">A nested
row</property>
+ </object>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Another nested
row</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwExpanderRow" id="enable_expander_row">
+ <property name="show_enable_switch">True</property>
+ <property name="title" translatable="yes">Toggleable
expander row</property>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">A nested
row</property>
+ </object>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Another nested
row</property>
+ </object>
+ </child>
</object>
</child>
</object>
</child>
</object>
- </child>
+ </property>
</object>
</property>
</object>
</property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">view-switcher</property>
- <property name="title" translatable="yes">View Switcher</property>
- <property name="child">
- <object class="AdwStatusPage">
- <property name="icon-name">widget-view-switcher-symbolic</property>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">view-switcher</property>
<property name="title" translatable="yes">View Switcher</property>
- <property name="description" translatable="yes">Widgets to switch the window's
view.</property>
- <child>
- <object class="GtkButton">
- <property name="label" translatable="yes">Run the demo</property>
- <property name="halign">center</property>
- <signal name="clicked" handler="view_switcher_demo_clicked_cb" swapped="no"/>
- <style>
- <class name="pill"/>
- </style>
+ <property name="child">
+ <object class="AdwStatusPage">
+ <property name="icon-name">widget-view-switcher-symbolic</property>
+ <property name="title" translatable="yes">View Switcher</property>
+ <property name="description" translatable="yes">Widgets to switch the
window's view.</property>
+ <child>
+ <object class="GtkButton">
+ <property name="label" translatable="yes">Run the demo</property>
+ <property name="halign">center</property>
+ <signal name="clicked" handler="view_switcher_demo_clicked_cb"
swapped="no"/>
+ <style>
+ <class name="pill"/>
+ </style>
+ </object>
+ </child>
</object>
- </child>
+ </property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">carousel</property>
- <property name="title" translatable="yes">Carousel</property>
- <property name="child">
- <object class="GtkBox" id="carousel_box">
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkBox" id="carousel_empty_box"/>
- </child>
- <child>
- <object class="AdwCarousel" id="carousel">
- <property name="vexpand">True</property>
- <property name="hexpand">True</property>
- <property name="allow-scroll-wheel" bind-source="carousel_scroll_wheel"
bind-property="active" bind-flags="sync-create|bidirectional"/>
- <property name="allow-long-swipes" bind-source="carousel_long_swipes"
bind-property="active" bind-flags="sync-create|bidirectional"/>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">carousel</property>
+ <property name="title" translatable="yes">Carousel</property>
+ <property name="child">
+ <object class="GtkBox" id="carousel_box">
+ <property name="orientation">vertical</property>
<child>
- <object class="AdwStatusPage">
- <property name="icon-name">widget-carousel-symbolic</property>
- <property name="title" translatable="yes">Carousel</property>
- <property name="description" translatable="yes">A widget for paginated
scrolling.</property>
- <property name="vexpand">True</property>
- </object>
+ <object class="GtkBox" id="carousel_empty_box"/>
</child>
<child>
- <object class="AdwClamp">
- <property name="margin-bottom">32</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="maximum-size">400</property>
- <property name="tightening-threshold">300</property>
- <property name="valign">center</property>
+ <object class="AdwCarousel" id="carousel">
+ <property name="vexpand">True</property>
+ <property name="hexpand">True</property>
+ <property name="allow-scroll-wheel" bind-source="carousel_scroll_wheel"
bind-property="active" bind-flags="sync-create|bidirectional"/>
+ <property name="allow-long-swipes" bind-source="carousel_long_swipes"
bind-property="active" bind-flags="sync-create|bidirectional"/>
<child>
- <object class="AdwPreferencesGroup">
+ <object class="AdwStatusPage">
+ <property name="icon-name">widget-carousel-symbolic</property>
+ <property name="title" translatable="yes">Carousel</property>
+ <property name="description" translatable="yes">A widget for
paginated scrolling.</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="AdwClamp">
+ <property name="margin-bottom">32</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="maximum-size">400</property>
+ <property name="tightening-threshold">300</property>
+ <property name="valign">center</property>
<child>
- <object class="AdwComboRow" id="carousel_orientation_row">
- <property name="title" translatable="yes">Orientation</property>
- <signal name="notify::selected"
handler="notify_carousel_orientation_cb" swapped="no"/>
- <property name="model">
- <object class="AdwEnumListModel">
- <property name="enum-type">GtkOrientation</property>
+ <object class="AdwPreferencesGroup">
+ <child>
+ <object class="AdwComboRow" id="carousel_orientation_row">
+ <property name="title"
translatable="yes">Orientation</property>
+ <signal name="notify::selected"
handler="notify_carousel_orientation_cb" swapped="no"/>
+ <property name="model">
+ <object class="AdwEnumListModel">
+ <property name="enum-type">GtkOrientation</property>
+ </object>
+ </property>
+ <property name="expression">
+ <closure type="gchararray"
function="carousel_orientation_name"/>
+ </property>
</object>
- </property>
- <property name="expression">
- <closure type="gchararray"
function="carousel_orientation_name"/>
- </property>
- </object>
- </child>
- <child>
- <object class="AdwComboRow" id="carousel_indicators_row">
- <property name="title" translatable="yes">Page
Indicators</property>
- <signal name="notify::selected"
handler="notify_carousel_indicators_cb" swapped="no"/>
- <property name="model">
- <object class="GtkStringList">
- <items>
- <item>dots</item>
- <item>lines</item>
- </items>
+ </child>
+ <child>
+ <object class="AdwComboRow" id="carousel_indicators_row">
+ <property name="title" translatable="yes">Page
Indicators</property>
+ <signal name="notify::selected"
handler="notify_carousel_indicators_cb" swapped="no"/>
+ <property name="model">
+ <object class="GtkStringList">
+ <items>
+ <item>dots</item>
+ <item>lines</item>
+ </items>
+ </object>
+ </property>
+ <property name="expression">
+ <closure type="gchararray"
function="carousel_indicators_name"/>
+ </property>
</object>
- </property>
- <property name="expression">
- <closure type="gchararray"
function="carousel_indicators_name"/>
- </property>
- </object>
- </child>
- <child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Scroll wheel</property>
- <property
name="activatable_widget">carousel_scroll_wheel</property>
+ </child>
<child>
- <object class="GtkSwitch" id="carousel_scroll_wheel">
- <property name="valign">center</property>
- <property name="active">True</property>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Scroll
wheel</property>
+ <property
name="activatable_widget">carousel_scroll_wheel</property>
+ <child>
+ <object class="GtkSwitch" id="carousel_scroll_wheel">
+ <property name="valign">center</property>
+ <property name="active">True</property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Long swipes</property>
- <property
name="activatable_widget">carousel_long_swipes</property>
<child>
- <object class="GtkSwitch" id="carousel_long_swipes">
- <property name="valign">center</property>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Long
swipes</property>
+ <property
name="activatable_widget">carousel_long_swipes</property>
+ <child>
+ <object class="GtkSwitch" id="carousel_long_swipes">
+ <property name="valign">center</property>
+ </object>
+ </child>
</object>
</child>
</object>
</child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="AdwStatusPage">
- <property name="title" translatable="yes">Another page</property>
- <property name="hexpand">True</property>
- <property name="child">
- <object class="GtkButton">
- <property name="label" translatable="yes">_Return to the first
page</property>
- <property name="use-underline">True</property>
- <property name="halign">center</property>
- <signal name="clicked" handler="carousel_return_clicked_cb"
swapped="no"/>
- <style>
- <class name="suggested-action"/>
- <class name="pill"/>
- </style>
+ <child>
+ <object class="AdwStatusPage">
+ <property name="title" translatable="yes">Another page</property>
+ <property name="hexpand">True</property>
+ <property name="child">
+ <object class="GtkButton">
+ <property name="label" translatable="yes">_Return to the first
page</property>
+ <property name="use-underline">True</property>
+ <property name="halign">center</property>
+ <signal name="clicked" handler="carousel_return_clicked_cb"
swapped="no"/>
+ <style>
+ <class name="suggested-action"/>
+ <class name="pill"/>
+ </style>
+ </object>
+ </property>
</object>
- </property>
+ </child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="GtkStack" id="carousel_indicators_stack">
- <property name="vhomogeneous">False</property>
- <property name="margin-top">6</property>
- <property name="margin-bottom">6</property>
- <property name="margin-start">6</property>
- <property name="margin-end">6</property>
<child>
- <object class="GtkStackPage">
- <property name="name">dots</property>
- <property name="child">
- <object class="AdwCarouselIndicatorDots">
- <property name="carousel">carousel</property>
- <property name="orientation" bind-source="carousel"
bind-property="orientation" bind-flags="sync-create"/>
+ <object class="GtkStack" id="carousel_indicators_stack">
+ <property name="vhomogeneous">False</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">6</property>
+ <property name="margin-start">6</property>
+ <property name="margin-end">6</property>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">dots</property>
+ <property name="child">
+ <object class="AdwCarouselIndicatorDots">
+ <property name="carousel">carousel</property>
+ <property name="orientation" bind-source="carousel"
bind-property="orientation" bind-flags="sync-create"/>
+ </object>
+ </property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">lines</property>
- <property name="child">
- <object class="AdwCarouselIndicatorLines">
- <property name="carousel">carousel</property>
- <property name="orientation" bind-source="carousel"
bind-property="orientation" bind-flags="sync-create"/>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">lines</property>
+ <property name="child">
+ <object class="AdwCarouselIndicatorLines">
+ <property name="carousel">carousel</property>
+ <property name="orientation" bind-source="carousel"
bind-property="orientation" bind-flags="sync-create"/>
+ </object>
+ </property>
</object>
- </property>
+ </child>
</object>
</child>
</object>
- </child>
+ </property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">avatar</property>
- <property name="title" translatable="yes">Avatar</property>
- <property name="child">
- <object class="GtkScrolledWindow">
- <property name="hscrollbar-policy">never</property>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">avatar</property>
+ <property name="title" translatable="yes">Avatar</property>
<property name="child">
- <object class="GtkViewport">
- <property name="scroll-to-focus">True</property>
+ <object class="GtkScrolledWindow">
+ <property name="hscrollbar-policy">never</property>
<property name="child">
- <object class="GtkBox">
- <property name="orientation">vertical</property>
- <property name="valign">start</property>
- <style>
- <class name="avatar-page"/>
- </style>
- <child>
+ <object class="GtkViewport">
+ <property name="scroll-to-focus">True</property>
+ <property name="child">
<object class="GtkBox">
<property name="orientation">vertical</property>
+ <property name="valign">start</property>
+ <style>
+ <class name="avatar-page"/>
+ </style>
<child>
- <object class="AdwAvatar" id="avatar">
- <property name="valign">center</property>
- <property name="halign">center</property>
- <property name="size" bind-source="avatar_size"
bind-property="value" bind-flags="sync-create"></property>
- <property name="show-initials"
bind-source="avatar_show_initials" bind-property="state" bind-flags="sync-create"/>
- <property name="text" bind-source="avatar_text"
bind-property="text" bind-flags="sync-create"/>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="label" translatable="yes">Avatar</property>
- <property name="halign">center</property>
- <property name="xalign">0</property>
- <property name="wrap">True</property>
- <property name="wrap-mode">word-char</property>
- <property name="justify">center</property>
- <style>
- <class name="title"/>
- <class name="large-title"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="label" translatable="yes">A user avatar with
generated fallback.</property>
- <property name="justify">center</property>
- <property name="use_markup">true</property>
- <property name="wrap">True</property>
- <style>
- <class name="body"/>
- <class name="description"/>
- </style>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="AdwClamp">
- <property name="maximum-size">400</property>
- <property name="tightening-threshold">300</property>
- <property name="child">
<object class="GtkBox">
- <property name="valign">center</property>
<property name="orientation">vertical</property>
- <property name="spacing">12</property>
<child>
- <object class="AdwPreferencesGroup">
+ <object class="AdwAvatar" id="avatar">
+ <property name="valign">center</property>
+ <property name="halign">center</property>
+ <property name="size" bind-source="avatar_size"
bind-property="value" bind-flags="sync-create"></property>
+ <property name="show-initials"
bind-source="avatar_show_initials" bind-property="state" bind-flags="sync-create"/>
+ <property name="text" bind-source="avatar_text"
bind-property="text" bind-flags="sync-create"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">Avatar</property>
+ <property name="halign">center</property>
+ <property name="xalign">0</property>
+ <property name="wrap">True</property>
+ <property name="wrap-mode">word-char</property>
+ <property name="justify">center</property>
+ <style>
+ <class name="title"/>
+ <class name="large-title"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">A user avatar with
generated fallback.</property>
+ <property name="justify">center</property>
+ <property name="use_markup">true</property>
+ <property name="wrap">True</property>
+ <style>
+ <class name="body"/>
+ <class name="description"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwClamp">
+ <property name="maximum-size">400</property>
+ <property name="tightening-threshold">300</property>
+ <property name="child">
+ <object class="GtkBox">
+ <property name="valign">center</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
<child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Text</property>
+ <object class="AdwPreferencesGroup">
<child>
- <object class="GtkEntry" id="avatar_text">
- <property name="valign">center</property>
+ <object class="AdwActionRow">
+ <property name="title"
translatable="yes">Text</property>
+ <child>
+ <object class="GtkEntry" id="avatar_text">
+ <property name="valign">center</property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Show
initials</property>
- <property
name="activatable_widget">avatar_show_initials</property>
<child>
- <object class="GtkSwitch" id="avatar_show_initials">
- <property name="valign">center</property>
- <property name="state">True</property>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Show
initials</property>
+ <property
name="activatable_widget">avatar_show_initials</property>
+ <child>
+ <object class="GtkSwitch"
id="avatar_show_initials">
+ <property name="valign">center</property>
+ <property name="state">True</property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">File</property>
<child>
- <object class="GtkButton">
- <property name="valign">center</property>
- <signal name="clicked"
handler="avatar_file_chooser_clicked_cb" swapped="true"/>
+ <object class="AdwActionRow">
+ <property name="title"
translatable="yes">File</property>
<child>
- <object class="GtkLabel"
id="avatar_file_chooser_label">
- <property name="ellipsize">middle</property>
- <property name="max-width-chars">20</property>
+ <object class="GtkButton">
+ <property name="valign">center</property>
+ <signal name="clicked"
handler="avatar_file_chooser_clicked_cb" swapped="true"/>
+ <child>
+ <object class="GtkLabel"
id="avatar_file_chooser_label">
+ <property name="ellipsize">middle</property>
+ <property
name="max-width-chars">20</property>
+ </object>
+ </child>
+ <style>
+ <class name="text-button"/>
+ <class name="outline"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton"
id="avatar_remove_button">
+ <property name="valign">center</property>
+ <property
name="icon_name">avatar-delete-symbolic</property>
+ <signal name="clicked" swapped="yes"
handler="avatar_file_remove_cb"/>
+ <style>
+ <class name="outline"/>
+ </style>
</object>
</child>
- <style>
- <class name="text-button"/>
- <class name="outline"/>
- </style>
</object>
</child>
<child>
- <object class="GtkButton" id="avatar_remove_button">
- <property name="valign">center</property>
- <property
name="icon_name">avatar-delete-symbolic</property>
- <signal name="clicked" swapped="yes"
handler="avatar_file_remove_cb"/>
- <style>
- <class name="outline"/>
- </style>
+ <object class="AdwActionRow">
+ <property name="title"
translatable="yes">Size</property>
+ <child>
+ <object class="GtkSpinButton" id="avatar_size">
+ <property name="valign">center</property>
+ <property name="numeric">True</property>
+ <property
name="adjustment">avatar_adjustment</property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Size</property>
<child>
- <object class="GtkSpinButton" id="avatar_size">
- <property name="valign">center</property>
- <property name="numeric">True</property>
- <property
name="adjustment">avatar_adjustment</property>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Export to
file</property>
+ <child>
+ <object class="GtkButton" id="avatar_save_file">
+ <property name="valign">center</property>
+ <property
name="icon_name">avatar-save-symbolic</property>
+ <signal name="clicked" swapped="yes"
handler="avatar_save_to_file_cb"/>
+ <style>
+ <class name="outline"/>
+ </style>
+ </object>
+ </child>
</object>
</child>
</object>
</child>
<child>
- <object class="AdwActionRow">
- <property name="title" translatable="yes">Export to
file</property>
- <child>
- <object class="GtkButton" id="avatar_save_file">
- <property name="valign">center</property>
- <property
name="icon_name">avatar-save-symbolic</property>
- <signal name="clicked" swapped="yes"
handler="avatar_save_to_file_cb"/>
- <style>
- <class name="outline"/>
- </style>
- </object>
- </child>
+ <object class="GtkListBox" id="avatar_contacts">
+ <property name="selection-mode">none</property>
+ <style>
+ <class name="boxed-list"/>
+ </style>
</object>
</child>
</object>
- </child>
- <child>
- <object class="GtkListBox" id="avatar_contacts">
- <property name="selection-mode">none</property>
- <style>
- <class name="boxed-list"/>
- </style>
- </object>
- </child>
+ </property>
</object>
- </property>
+ </child>
</object>
- </child>
+ </property>
</object>
</property>
</object>
</property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">flap</property>
- <property name="title" translatable="yes">Flap</property>
- <property name="child">
- <object class="AdwStatusPage">
- <property name="icon-name">widget-flap-symbolic</property>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">flap</property>
<property name="title" translatable="yes">Flap</property>
- <property name="description" translatable="yes">A widget showing a flap next to
or above the content.</property>
<property name="child">
- <object class="GtkButton">
- <property name="label" translatable="yes">Run the demo</property>
- <property name="halign">center</property>
- <signal name="clicked" handler="flap_demo_clicked_cb" swapped="no"/>
- <style>
- <class name="pill"/>
- </style>
+ <object class="AdwStatusPage">
+ <property name="icon-name">widget-flap-symbolic</property>
+ <property name="title" translatable="yes">Flap</property>
+ <property name="description" translatable="yes">A widget showing a flap next
to or above the content.</property>
+ <property name="child">
+ <object class="GtkButton">
+ <property name="label" translatable="yes">Run the demo</property>
+ <property name="halign">center</property>
+ <signal name="clicked" handler="flap_demo_clicked_cb" swapped="no"/>
+ <style>
+ <class name="pill"/>
+ </style>
+ </object>
+ </property>
</object>
</property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">tab-view</property>
- <property name="title" translatable="yes">Tab View</property>
- <property name="child">
- <object class="AdwStatusPage">
- <property name="icon-name">widget-tab-view-symbolic</property>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">tab-view</property>
<property name="title" translatable="yes">Tab View</property>
- <property name="description" translatable="yes">A modern tab widget.</property>
<property name="child">
- <object class="GtkButton">
- <property name="label" translatable="yes">Run the demo</property>
- <property name="halign">center</property>
- <signal name="clicked" handler="tab_view_demo_clicked_cb" swapped="no"/>
- <style>
- <class name="pill"/>
- </style>
+ <object class="AdwStatusPage">
+ <property name="icon-name">widget-tab-view-symbolic</property>
+ <property name="title" translatable="yes">Tab View</property>
+ <property name="description" translatable="yes">A modern tab
widget.</property>
+ <property name="child">
+ <object class="GtkButton">
+ <property name="label" translatable="yes">Run the demo</property>
+ <property name="halign">center</property>
+ <signal name="clicked" handler="tab_view_demo_clicked_cb" swapped="no"/>
+ <style>
+ <class name="pill"/>
+ </style>
+ </object>
+ </property>
</object>
</property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">buttons</property>
- <property name="title" translatable="yes">Buttons</property>
- <property name="child">
- <object class="AdwStatusPage">
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">buttons</property>
<property name="title" translatable="yes">Buttons</property>
- <property name="description" translatable="yes">Button helper widgets.</property>
<property name="child">
- <object class="AdwClamp">
- <property name="maximum-size">400</property>
- <property name="tightening-threshold">300</property>
+ <object class="AdwStatusPage">
+ <property name="title" translatable="yes">Buttons</property>
+ <property name="description" translatable="yes">Button helper
widgets.</property>
<property name="child">
- <object class="GtkBox">
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkGrid">
- <property name="halign">center</property>
- <property name="column-spacing">12</property>
- <property name="row-spacing">12</property>
- <child>
- <object class="AdwSplitButton">
- <property name="icon-name">document-open-symbolic</property>
- <property name="menu-model">sample_menu</property>
- <layout>
- <property name="column">0</property>
- <property name="row">0</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="AdwSplitButton">
- <property name="icon-name">document-open-symbolic</property>
- <property name="menu-model">sample_menu</property>
- <style>
- <class name="flat"/>
- </style>
- <layout>
- <property name="column">0</property>
- <property name="row">1</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="AdwSplitButton">
- <property name="label" translatable="yes">_Open</property>
- <property name="use-underline">True</property>
- <property name="menu-model">sample_menu</property>
- <layout>
- <property name="column">1</property>
- <property name="row">0</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="AdwSplitButton">
- <property name="label" translatable="yes">_Open</property>
- <property name="use-underline">True</property>
- <property name="menu-model">sample_menu</property>
- <style>
- <class name="flat"/>
- </style>
- <layout>
- <property name="column">1</property>
- <property name="row">1</property>
- </layout>
- </object>
- </child>
+ <object class="AdwClamp">
+ <property name="maximum-size">400</property>
+ <property name="tightening-threshold">300</property>
+ <property name="child">
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
<child>
- <object class="AdwSplitButton">
- <property name="child">
- <object class="AdwButtonContent">
+ <object class="GtkGrid">
+ <property name="halign">center</property>
+ <property name="column-spacing">12</property>
+ <property name="row-spacing">12</property>
+ <child>
+ <object class="AdwSplitButton">
<property name="icon-name">document-open-symbolic</property>
+ <property name="menu-model">sample_menu</property>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="AdwSplitButton">
+ <property name="icon-name">document-open-symbolic</property>
+ <property name="menu-model">sample_menu</property>
+ <style>
+ <class name="flat"/>
+ </style>
+ <layout>
+ <property name="column">0</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="AdwSplitButton">
<property name="label" translatable="yes">_Open</property>
<property name="use-underline">True</property>
+ <property name="menu-model">sample_menu</property>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">0</property>
+ </layout>
</object>
- </property>
- <property name="menu-model">sample_menu</property>
- <layout>
- <property name="column">2</property>
- <property name="row">0</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="AdwSplitButton">
- <property name="child">
- <object class="AdwButtonContent">
- <property name="icon-name">document-open-symbolic</property>
+ </child>
+ <child>
+ <object class="AdwSplitButton">
<property name="label" translatable="yes">_Open</property>
<property name="use-underline">True</property>
+ <property name="menu-model">sample_menu</property>
+ <style>
+ <class name="flat"/>
+ </style>
+ <layout>
+ <property name="column">1</property>
+ <property name="row">1</property>
+ </layout>
</object>
- </property>
- <property name="menu-model">sample_menu</property>
- <style>
- <class name="flat"/>
- </style>
- <layout>
- <property name="column">2</property>
- <property name="row">1</property>
- </layout>
+ </child>
+ <child>
+ <object class="AdwSplitButton">
+ <property name="child">
+ <object class="AdwButtonContent">
+ <property
name="icon-name">document-open-symbolic</property>
+ <property name="label"
translatable="yes">_Open</property>
+ <property name="use-underline">True</property>
+ </object>
+ </property>
+ <property name="menu-model">sample_menu</property>
+ <layout>
+ <property name="column">2</property>
+ <property name="row">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="AdwSplitButton">
+ <property name="child">
+ <object class="AdwButtonContent">
+ <property
name="icon-name">document-open-symbolic</property>
+ <property name="label"
translatable="yes">_Open</property>
+ <property name="use-underline">True</property>
+ </object>
+ </property>
+ <property name="menu-model">sample_menu</property>
+ <style>
+ <class name="flat"/>
+ </style>
+ <layout>
+ <property name="column">2</property>
+ <property name="row">1</property>
+ </layout>
+ </object>
+ </child>
</object>
</child>
</object>
- </child>
+ </property>
</object>
</property>
</object>
</property>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">style-classes</property>
- <property name="title" translatable="yes">Style Classes</property>
- <property name="child">
- <object class="AdwStatusPage">
- <property name="icon-name">style-classes-symbolic</property>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">style-classes</property>
<property name="title" translatable="yes">Style Classes</property>
- <property name="description" translatable="yes">Various widget styles available
for use.</property>
<property name="child">
- <object class="GtkButton">
- <property name="label" translatable="yes">Run the demo</property>
- <property name="halign">center</property>
- <signal name="clicked" handler="style_classes_demo_clicked_cb" swapped="no"/>
- <style>
- <class name="pill"/>
- </style>
+ <object class="AdwStatusPage">
+ <property name="icon-name">style-classes-symbolic</property>
+ <property name="title" translatable="yes">Style Classes</property>
+ <property name="description" translatable="yes">Various widget styles
available for use.</property>
+ <property name="child">
+ <object class="GtkButton">
+ <property name="label" translatable="yes">Run the demo</property>
+ <property name="halign">center</property>
+ <signal name="clicked" handler="style_classes_demo_clicked_cb"
swapped="no"/>
+ <style>
+ <class name="pill"/>
+ </style>
+ </object>
+ </property>
</object>
</property>
</object>
- </property>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">toast</property>
+ <property name="title" translatable="yes">Toast</property>
+ <property name="child">
+ <object class="AdwStatusPage">
+ <property
name="icon-name">preferences-system-notifications-symbolic</property>
+ <property name="title" translatable="yes">Toast</property>
+ <property name="description" translatable="yes">Transient in-app
notifications.</property>
+ <property name="child">
+ <object class="AdwClamp">
+ <property name="maximum-size">400</property>
+ <property name="tightening-threshold">300</property>
+ <property name="child">
+ <object class="AdwPreferencesGroup">
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Simple toast</property>
+ <child>
+ <object class="GtkButton">
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">Show</property>
+ <signal name="clicked" handler="add_toast_cb"
swapped="true"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Toast with an
action</property>
+ <child>
+ <object class="GtkButton">
+ <property name="valign">center</property>
+ <property name="icon-name">user-trash-symbolic</property>
+ <property name="action-name">toast.dismiss</property>
+ <style>
+ <class name="flat"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">Show</property>
+ <signal name="clicked" handler="add_toast_with_button_cb"
swapped="true"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Toast with a long
title</property>
+ <child>
+ <object class="GtkButton">
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">Show</property>
+ <signal name="clicked"
handler="add_toast_with_long_title_cb" swapped="true"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </property>
+ </object>
+ </property>
+ </object>
+ </property>
+ </object>
+ </child>
</object>
</child>
</object>
</child>
</object>
</child>
- </object>
- </child>
- <child>
- <object class="GtkBox">
- <property name="orientation">vertical</property>
<child>
- <object class="AdwHeaderBar">
- <property name="title-widget">
- <object class="GtkBox"/>
- </property>
- <child type="start">
- <object class="GtkButton">
- <property name="valign">center</property>
- <property name="tooltip-text" translatable="yes">Back</property>
- <property name="icon-name">go-previous-symbolic</property>
- <signal name="clicked" handler="leaflet_back_clicked_cb"/>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="AdwStatusPage">
- <property name="vexpand">True</property>
- <property name="title" translatable="yes">Go back</property>
- <property name="child">
- <object class="GtkBox">
- <property name="orientation">vertical</property>
- <property name="halign">center</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkImage">
- <property name="icon-name">gesture-touchscreen-swipe-back-symbolic</property>
- <property name="pixel-size">128</property>
- <style>
- <class name="dim-label"/>
- </style>
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="AdwHeaderBar">
+ <property name="title-widget">
+ <object class="GtkBox"/>
+ </property>
+ <child type="start">
+ <object class="GtkButton">
+ <property name="valign">center</property>
+ <property name="tooltip-text" translatable="yes">Back</property>
+ <property name="icon-name">go-previous-symbolic</property>
+ <signal name="clicked" handler="leaflet_back_clicked_cb"/>
</object>
</child>
- <child>
- <object class="GtkImage">
- <property name="icon-name">gesture-touchpad-swipe-back-symbolic</property>
- <property name="pixel-size">128</property>
- <style>
- <class name="dim-label"/>
- </style>
+ </object>
+ </child>
+ <child>
+ <object class="AdwStatusPage">
+ <property name="vexpand">True</property>
+ <property name="title" translatable="yes">Go back</property>
+ <property name="child">
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="halign">center</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">gesture-touchscreen-swipe-back-symbolic</property>
+ <property name="pixel-size">128</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImage">
+ <property name="icon-name">gesture-touchpad-swipe-back-symbolic</property>
+ <property name="pixel-size">128</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
</object>
- </child>
+ </property>
</object>
- </property>
+ </child>
</object>
</child>
</object>
- </child>
+ </property>
</object>
</child>
</template>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]