[gnome-software: 65/110] gs-shell: Declare AdwLeaflet pages with AdwLeafletPage
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 65/110] gs-shell: Declare AdwLeaflet pages with AdwLeafletPage
- Date: Tue, 5 Oct 2021 20:32:39 +0000 (UTC)
commit 973c11cd3ad39b6dd66d0476dd4ef87840f4eb78
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Aug 25 12:15:26 2021 -0300
gs-shell: Declare AdwLeaflet pages with AdwLeafletPage
This is exactly similar to GtkStack, which makes sense since
AdwLeaflet behaves like a stack.
src/gs-shell.ui | 593 +++++++++++++++++++++++++++++---------------------------
1 file changed, 304 insertions(+), 289 deletions(-)
---
diff --git a/src/gs-shell.ui b/src/gs-shell.ui
index e659057f3..fb9fc201c 100644
--- a/src/gs-shell.ui
+++ b/src/gs-shell.ui
@@ -160,240 +160,351 @@
<property name="visible">True</property>
<property name="can-unfold">False</property>
<signal name="notify::visible-child" handler="stack_notify_visible_child_cb"/>
+
+
<child>
- <object class="AdwLeaflet" id="main_leaflet">
- <property name="visible">True</property>
- <property name="can-unfold">False</property>
- <signal name="notify::visible-child" handler="stack_notify_visible_child_cb"/>
- <child>
- <object class="GtkBox" id="main_box">
+ <object class="AdwLeafletPage">
+ <property name="name">main</property>
+ <property name="child">
+ <object class="AdwLeaflet" id="main_leaflet">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can-unfold">False</property>
+ <signal name="notify::visible-child" handler="stack_notify_visible_child_cb"/>
+
<child>
- <object class="AdwHeaderBar" id="main_header">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="hexpand">True</property>
- <property name="show-end-title-buttons">True</property>
- <property name="centering-policy">strict</property>
- <child>
- <object class="GtkToggleButton" id="search_button">
+ <object class="AdwLeafletPage">
+ <property name="name">main</property>
+ <property name="child">
+ <object class="GtkBox" id="main_box">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="active" bind-source="search_bar"
bind-property="search-mode-enabled" bind-flags="sync-create|bidirectional"/>
- <signal name="clicked" handler="search_button_clicked_cb"/>
- <accessibility>
- <property name="label" translatable="yes">Search</property>
- </accessibility>
- <style>
- <class name="image-button"/>
- </style>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkImage">
+ <object class="AdwHeaderBar" id="main_header">
<property name="visible">True</property>
- <property name="icon_name">edit-find-symbolic</property>
- <property name="icon_size">1</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="show-end-title-buttons">True</property>
+ <property name="centering-policy">strict</property>
+ <child>
+ <object class="GtkToggleButton" id="search_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="active" bind-source="search_bar"
bind-property="search-mode-enabled" bind-flags="sync-create|bidirectional"/>
+ <signal name="clicked" handler="search_button_clicked_cb"/>
+ <accessibility>
+ <property name="label" translatable="yes">Search</property>
+ </accessibility>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon_name">edit-find-symbolic</property>
+ <property name="icon_size">1</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="pack-type">start</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkMenuButton" id="menu_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="sensitive">True</property>
+ <property name="menu_model">primary_menu</property>
+ <accessibility>
+ <property name="label" translatable="yes">Primary
Menu</property>
+ </accessibility>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon_name">open-menu-symbolic</property>
+ <property name="icon_size">1</property>
+ </object>
+ </child>
+ <style>
+ <class name="image-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
+ <child type="title">
+ <object class="AdwViewSwitcherTitle" id="title_switcher">
+ <property name="visible">True</property>
+ <property name="stack">stack_main</property>
+ <property name="title" bind-source="GsShell"
bind-property="title" bind-flags="sync-create"/>
+ </object>
+ </child>
</object>
</child>
- </object>
- <packing>
- <property name="pack-type">start</property>
- </packing>
- </child>
- <child>
- <object class="GtkMenuButton" id="menu_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="sensitive">True</property>
- <property name="menu_model">primary_menu</property>
- <accessibility>
- <property name="label" translatable="yes">Primary Menu</property>
- </accessibility>
<child>
- <object class="GtkImage">
+ <object class="GtkSearchBar" id="search_bar">
<property name="visible">True</property>
- <property name="icon_name">open-menu-symbolic</property>
- <property name="icon_size">1</property>
+ <property name="key-capture-widget">GsShell</property>
+ <child>
+ <object class="AdwClamp">
+ <property name="visible">True</property>
+ <property name="hexpand">True</property>
+ <property name="maximum_size">500</property>
+ <property name="tightening_threshold">500</property>
+ <child>
+ <object class="GtkSearchEntry" id="entry_search">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="activates_default">True</property>
+ <property name="max_length">100</property>
+ <signal name="search-changed"
handler="search_changed_handler"/>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
- <style>
- <class name="image-button"/>
- </style>
- </object>
- <packing>
- <property name="pack-type">end</property>
- </packing>
- </child>
- <child type="title">
- <object class="AdwViewSwitcherTitle" id="title_switcher">
- <property name="visible">True</property>
- <property name="stack">stack_main</property>
- <property name="title" bind-source="GsShell" bind-property="title"
bind-flags="sync-create"/>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkSearchBar" id="search_bar">
- <property name="visible">True</property>
- <property name="key-capture-widget">GsShell</property>
- <child>
- <object class="AdwClamp">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="maximum_size">500</property>
- <property name="tightening_threshold">500</property>
<child>
- <object class="GtkSearchEntry" id="entry_search">
+ <object class="GtkInfoBar" id="metered_updates_bar">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="activates_default">True</property>
- <property name="max_length">100</property>
- <signal name="search-changed" handler="search_changed_handler"/>
+ <property name="orientation">horizontal</property>
+ <property name="spacing">12</property>
+ <property name="message-type">GTK_MESSAGE_INFO</property>
+ <property name="show-close-button">False</property>
+ <property name="revealed">False</property>
+ <signal name="response"
handler="gs_shell_metered_updates_bar_response_cb"/>
+ <child internal-child="content_area">
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <property name="margin_top">6</property>
+ <property name="margin_left">6</property>
+ <property name="margin_bottom">6</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Automatic Updates
Paused</property>
+ <property name="xalign">0.0</property>
+ <property name="wrap">True</property>
+ <attributes>
+ <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="margin_right">6</property>
+ <child>
+ <object class="GtkButton" id="metered_updates_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="use_underline">True</property>
+ <property name="label" translatable="yes">Find Out
_More</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget
response="GTK_RESPONSE_OK">metered_updates_button</action-widget>
+ </action-widgets>
</object>
</child>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkInfoBar" id="metered_updates_bar">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <property name="spacing">12</property>
- <property name="message-type">GTK_MESSAGE_INFO</property>
- <property name="show-close-button">False</property>
- <property name="revealed">False</property>
- <signal name="response" handler="gs_shell_metered_updates_bar_response_cb"/>
- <child internal-child="content_area">
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <property name="margin_top">6</property>
- <property name="margin_left">6</property>
- <property name="margin_bottom">6</property>
<child>
- <object class="GtkLabel">
+ <object class="GtkStack" id="stack_main">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Automatic Updates
Paused</property>
- <property name="xalign">0.0</property>
- <property name="wrap">True</property>
- <attributes>
- <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
- </attributes>
+ <property name="homogeneous">False</property>
+ <property name="transition-type">crossfade</property>
+ <signal name="notify::visible-child"
handler="stack_notify_visible_child_cb"/>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">overview</property>
+ <property name="title" translatable="yes" comments="Translators:
A label for a button to show all available software.">Explore</property>
+ <property name="icon-name">explore2-symbolic</property>
+ <property name="child">
+ <object class="GsOverviewPage" id="overview_page">
+ <property name="visible">True</property>
+ </object>
+ </property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">installed</property>
+ <!-- FIXME: Add mnemonics support when it’s supported in GTK
(same for the other pages).
+ See https://gitlab.gnome.org/GNOME/gtk/-/issues/3134 -->
+ <property name="title" translatable="yes" comments="Translators:
A label for a button to show only software which is already installed.">Installed</property>
+ <property name="icon-name">app-installed-symbolic</property>
+ <property name="child">
+ <object class="GsInstalledPage" id="installed_page">
+ <property name="visible">True</property>
+ <property name="is-narrow" bind-source="GsShell"
bind-property="is-narrow" bind-flags="sync-create"/>
+ </object>
+ </property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">search</property>
+ <property name="child">
+ <object class="GsSearchPage" id="search_page">
+ <property name="visible">True</property>
+ </object>
+ </property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">updates</property>
+ <property name="title" translatable="yes" comments="Translators:
A label for a button to show only updates which are available to install.">Updates</property>
+ <property
name="icon-name">emblem-synchronizing-symbolic</property>
+ <property name="child">
+ <object class="GsUpdatesPage" id="updates_page">
+ <property name="visible">True</property>
+ <property name="is-narrow" bind-source="GsShell"
bind-property="is-narrow" bind-flags="sync-create"/>
+ <signal name="notify::counter"
handler="updates_page_notify_counter_cb"/>
+ </object>
+ </property>
+ </object>
+ </child>
</object>
</child>
- </object>
- </child>
- <child internal-child="action_area">
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="margin_right">6</property>
<child>
- <object class="GtkButton" id="metered_updates_button">
+ <object class="AdwViewSwitcherBar" id="sidebar_switcher">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="use_underline">True</property>
- <property name="label" translatable="yes">Find Out _More</property>
+ <property name="reveal" bind-source="title_switcher"
bind-property="title-visible" bind-flags="sync-create"/>
+ <property name="stack">stack_main</property>
</object>
</child>
</object>
- </child>
- <action-widgets>
- <action-widget
response="GTK_RESPONSE_OK">metered_updates_button</action-widget>
- </action-widgets>
+ </property>
</object>
</child>
+
<child>
- <object class="GtkStack" id="stack_main">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="transition-type">crossfade</property>
- <signal name="notify::visible-child"
handler="stack_notify_visible_child_cb"/>
- <child>
- <object class="GtkStackPage">
- <property name="name">overview</property>
- <property name="title" translatable="yes" comments="Translators: A label
for a button to show all available software.">Explore</property>
- <property name="icon-name">explore2-symbolic</property>
- <property name="child">
- <object class="GsOverviewPage" id="overview_page">
- <property name="visible">True</property>
- </object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">installed</property>
- <!-- FIXME: Add mnemonics support when it’s supported in GTK (same for
the other pages).
- See https://gitlab.gnome.org/GNOME/gtk/-/issues/3134 -->
- <property name="title" translatable="yes" comments="Translators: A label
for a button to show only software which is already installed.">Installed</property>
- <property name="icon-name">app-installed-symbolic</property>
- <property name="child">
- <object class="GsInstalledPage" id="installed_page">
- <property name="visible">True</property>
- <property name="is-narrow" bind-source="GsShell"
bind-property="is-narrow" bind-flags="sync-create"/>
- </object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">search</property>
- <property name="child">
- <object class="GsSearchPage" id="search_page">
+ <object class="AdwLeafletPage">
+ <property name="name">sub</property>
+ <property name="child">
+ <object class="GtkBox" id="sub_box">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="AdwHeaderBar" id="sub_header">
<property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="show-end-title-buttons">True</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkButton" id="button_back">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <signal name="clicked" handler="gs_shell_back_button_cb"/>
+ <accessibility>
+ <property name="label" translatable="yes">Go back</property>
+ </accessibility>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage" id="back_image">
+ <property name="visible">True</property>
+ <property name="icon_name">go-previous-symbolic</property>
+ <property name="icon_size">1</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="title">
+ <object class="GtkLabel" id="sub_page_header_title">
+ <property name="visible">True</property>
+ <property name="selectable">False</property>
+ <property name="ellipsize">end</property>
+ <style>
+ <class name="title"/>
+ </style>
+ </object>
+ </child>
</object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">updates</property>
- <property name="title" translatable="yes" comments="Translators: A label
for a button to show only updates which are available to install.">Updates</property>
- <property name="icon-name">emblem-synchronizing-symbolic</property>
- <property name="child">
- <object class="GsUpdatesPage" id="updates_page">
+ </child>
+ <child>
+ <object class="GtkStack" id="stack_sub">
<property name="visible">True</property>
- <property name="is-narrow" bind-source="GsShell"
bind-property="is-narrow" bind-flags="sync-create"/>
- <signal name="notify::counter"
handler="updates_page_notify_counter_cb"/>
+ <property name="homogeneous">False</property>
+ <property name="transition-type">crossfade</property>
+ <signal name="notify::visible-child"
handler="stack_notify_visible_child_cb"/>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">moderate</property>
+ <property name="child">
+ <object class="GsModeratePage" id="moderate_page">
+ <property name="visible">True</property>
+ </object>
+ </property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">category</property>
+ <property name="child">
+ <object class="GsCategoryPage" id="category_page">
+ <property name="visible">True</property>
+ <signal name="app-clicked"
handler="category_page_app_clicked_cb"/>
+ </object>
+ </property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkStackPage">
+ <property name="name">extras</property>
+ <property name="child">
+ <object class="GsExtrasPage" id="extras_page">
+ <property name="visible">True</property>
+ </object>
+ </property>
+ </object>
+ </child>
</object>
- </property>
+ </child>
</object>
- </child>
- </object>
- </child>
- <child>
- <object class="AdwViewSwitcherBar" id="sidebar_switcher">
- <property name="visible">True</property>
- <property name="reveal" bind-source="title_switcher"
bind-property="title-visible" bind-flags="sync-create"/>
- <property name="stack">stack_main</property>
+ </property>
</object>
</child>
+
</object>
- <packing>
- <property name="name">main</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="sub_box">
+ </property>
+ </object>
+ </child>
+
+ <child>
+ <object class="AdwLeafletPage">
+ <property name="name">details</property>
+ <property name="child">
+ <object class="GtkBox" id="details_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
- <object class="AdwHeaderBar" id="sub_header">
+ <object class="AdwHeaderBar" id="details_header">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="show-end-title-buttons">True</property>
<property name="hexpand">True</property>
+ <property name="show-end-title-buttons">True</property>
+ <property name="title-widget">
+ <object class="AdwWindowTitle">
+ <property name="title" bind-source="details_page" bind-property="title"
bind-flags="sync-create"/>
+ </object>
+ </property>
<child>
- <object class="GtkButton" id="button_back">
+ <object class="GtkButton" id="button_back2">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <signal name="clicked" handler="gs_shell_back_button_cb"/>
+ <signal name="clicked" handler="gs_shell_details_back_button_cb"/>
<accessibility>
<property name="label" translatable="yes">Go back</property>
</accessibility>
@@ -401,7 +512,7 @@
<class name="image-button"/>
</style>
<child>
- <object class="GtkImage" id="back_image">
+ <object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">go-previous-symbolic</property>
<property name="icon_size">1</property>
@@ -409,115 +520,19 @@
</child>
</object>
</child>
- <child type="title">
- <object class="GtkLabel" id="sub_page_header_title">
- <property name="visible">True</property>
- <property name="selectable">False</property>
- <property name="ellipsize">end</property>
- <style>
- <class name="title"/>
- </style>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkStack" id="stack_sub">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="transition-type">crossfade</property>
- <signal name="notify::visible-child"
handler="stack_notify_visible_child_cb"/>
- <child>
- <object class="GtkStackPage">
- <property name="name">moderate</property>
- <property name="child">
- <object class="GsModeratePage" id="moderate_page">
- <property name="visible">True</property>
- </object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">category</property>
- <property name="child">
- <object class="GsCategoryPage" id="category_page">
- <property name="visible">True</property>
- <signal name="app-clicked" handler="category_page_app_clicked_cb"/>
- </object>
- </property>
- </object>
- </child>
- <child>
- <object class="GtkStackPage">
- <property name="name">extras</property>
- <property name="child">
- <object class="GsExtrasPage" id="extras_page">
- <property name="visible">True</property>
- </object>
- </property>
- </object>
- </child>
</object>
</child>
- </object>
- <packing>
- <property name="name">sub</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="name">main</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="details_box">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="AdwHeaderBar" id="details_header">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="hexpand">True</property>
- <property name="show-end-title-buttons">True</property>
- <property name="title-widget">
- <object class="AdwWindowTitle">
- <property name="title" bind-source="details_page" bind-property="title"
bind-flags="sync-create"/>
- </object>
- </property>
<child>
- <object class="GtkButton" id="button_back2">
+ <object class="GsDetailsPage" id="details_page">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <signal name="clicked" handler="gs_shell_details_back_button_cb"/>
- <accessibility>
- <property name="label" translatable="yes">Go back</property>
- </accessibility>
- <style>
- <class name="image-button"/>
- </style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon_name">go-previous-symbolic</property>
- <property name="icon_size">1</property>
- </object>
- </child>
+ <property name="is-narrow" bind-source="GsShell" bind-property="is-narrow"
bind-flags="sync-create"/>
</object>
</child>
</object>
- </child>
- <child>
- <object class="GsDetailsPage" id="details_page">
- <property name="visible">True</property>
- <property name="is-narrow" bind-source="GsShell" bind-property="is-narrow"
bind-flags="sync-create"/>
- </object>
- </child>
+ </property>
</object>
- <packing>
- <property name="name">details</property>
- </packing>
</child>
+
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]