[gnome-games/wip/exalm/statuspage: 4/6] collection-action-page: Use HdyStatusPage




commit f35806d3e9bbf3be7d5e3b36b17012066be8c064
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Dec 29 03:00:08 2020 +0500

    collection-action-page: Use HdyStatusPage

 src/ui/collection-action-window.ui   | 185 +++++++++--------------------------
 src/ui/collection-action-window.vala |   2 +-
 2 files changed, 46 insertions(+), 141 deletions(-)
---
diff --git a/src/ui/collection-action-window.ui b/src/ui/collection-action-window.ui
index ff5eabcb..21857a3a 100644
--- a/src/ui/collection-action-window.ui
+++ b/src/ui/collection-action-window.ui
@@ -93,6 +93,7 @@
             <child>
               <object class="GtkStack" id="user_collections_page_stack">
                 <property name="visible">True</property>
+                <property name="vexpand">True</property>
                 <child>
                   <object class="GtkScrolledWindow" id="list_page">
                     <property name="visible">True</property>
@@ -121,84 +122,23 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkBox" id="empty_page">
+                  <object class="HdyStatusPage" id="empty_page">
                     <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <object class="GtkBox">
-                        <property name="visible">True</property>
-                        <property name="orientation">vertical</property>
-                        <property name="vexpand">True</property>
-                        <property name="valign">center</property>
-                        <child>
-                          <object class="GtkImage">
-                            <property name="visible">True</property>
-                            <property name="pixel-size">96</property>
-                            <property name="icon-name">folder-symbolic</property>
-                            <property name="margin-top">18</property>
-                            <property name="margin-bottom">18</property>
-                            <property name="margin-start">18</property>
-                            <property name="margin-end">18</property>
-                            <style>
-                              <class name="dim-label"/>
-                            </style>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="GtkLabel">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">No collections found</property>
-                            <property name="justify">center</property>
-                            <property name="wrap">True</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>
-                            <style>
-                              <class name="dim-label"/>
-                            </style>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                              <attribute name="scale" value="2"/>
-                            </attributes>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="GtkLabel">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">Add a new collection to add games to 
it.</property>
-                            <property name="justify">center</property>
-                            <property name="wrap">True</property>
-                            <style>
-                              <class name="dim-label"/>
-                            </style>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
+                    <property name="icon-name">folder-symbolic</property>
+                    <property name="title" translatable="yes">No collections found</property>
+                    <property name="description" translatable="yes">Add a new collection to add games to 
it.</property>
                     <child>
                       <object class="GtkButton">
                         <property name="visible">True</property>
                         <property name="label" translatable="yes">Create Collection</property>
+                        <property name="tooltip-text" translatable="yes">Create a collection</property>
                         <property name="halign">center</property>
-                        <property name="margin-top">24</property>
-                        <property name="margin-bottom">24</property>
-                        <property name="margin-start">24</property>
-                        <property name="margin-end">24</property>
                         <property name="action-name">collection-action.new-collection</property>
-                        <child internal-child="accessible">
-                          <object class="AtkObject">
-                            <property name="accessible-name" translatable="yes">Create a 
collection</property>
-                          </object>
-                        </child>
                         <style>
                           <class name="suggested-action"/>
                           <class name="pill-button"/>
                         </style>
                       </object>
-                      <packing>
-                        <property name="pack-type">end</property>
-                      </packing>
                     </child>
                   </object>
                 </child>
@@ -241,85 +181,50 @@
               </object>
             </child>
             <child>
-              <object class="GtkBox">
+              <object class="HdyStatusPage">
                 <property name="visible">True</property>
-                <property name="orientation">vertical</property>
+                <property name="icon-name">folder-new-symbolic</property>
+                <property name="title" translatable="yes">Enter a collection name</property>
+                <property name="vexpand">True</property>
                 <child>
-                  <object class="GtkImage">
+                  <object class="GtkBox">
                     <property name="visible">True</property>
-                    <property name="valign">center</property>
-                    <property name="pixel-size">96</property>
-                    <property name="icon-name">folder-new-symbolic</property>
-                    <property name="vexpand">True</property>
-                    <property name="margin-top">18</property>
-                    <property name="margin-bottom">18</property>
-                    <property name="margin-start">18</property>
-                    <property name="margin-end">18</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkLabel">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">Enter a collection name</property>
-                    <property name="valign">end</property>
-                    <property name="margin-top">18</property>
-                    <property name="margin-bottom">18</property>
-                    <property name="margin-start">18</property>
-                    <property name="margin-end">18</property>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkEntry" id="name_entry">
-                    <property name="visible">True</property>
-                    <property name="width-request">300</property>
-                    <property name="height-request">10</property>
-                    <property name="halign">center</property>
-                    <property name="margin-top">12</property>
-                    <property name="margin-bottom">12</property>
-                    <property name="margin-start">12</property>
-                    <property name="margin-end">12</property>
-                    <signal name="notify::text" handler="on_collection_name_entry_changed"/>
-                    <signal name="activate" handler="create_collection"/>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="error_label">
-                    <property name="visible">True</property>
-                    <property name="valign">end</property>
-                    <property name="margin-top">12</property>
-                    <property name="margin-bottom">12</property>
-                    <property name="margin-start">12</property>
-                    <property name="margin-end">12</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkButton">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">C_reate</property>
-                    <property name="use-underline">True</property>
-                    <property name="sensitive" bind-source="GamesCollectionActionWindow" 
bind-property="is-collection-name-valid" bind-flags="sync-create"/>
-                    <property name="margin-top">24</property>
-                    <property name="margin-bottom">24</property>
-                    <property name="margin-start">24</property>
-                    <property name="margin-end">24</property>
-                    <property name="halign">center</property>
-                    <property name="valign">center</property>
-                    <property name="action-name">collection-action.create-collection</property>
-                    <child internal-child="accessible">
-                      <object class="AtkObject">
-                        <property name="accessible-name" translatable="yes">Create collection</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">24</property>
+                    <child>
+                      <object class="GtkEntry" id="name_entry">
+                        <property name="visible">True</property>
+                        <property name="width-request">300</property>
+                        <property name="halign">center</property>
+                        <signal name="notify::text" handler="on_collection_name_entry_changed"/>
+                        <signal name="activate" handler="create_collection"/>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="error_label">
+                        <property name="visible">True</property>
+                        <property name="halign">center</property>
+                        <style>
+                          <class name="dim-label"/>
+                        </style>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkButton">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">C_reate</property>
+                        <property name="tooltip-text" translatable="yes">Create a collection</property>
+                        <property name="use-underline">True</property>
+                        <property name="sensitive" bind-source="GamesCollectionActionWindow" 
bind-property="is-collection-name-valid" bind-flags="sync-create"/>
+                        <property name="margin-top">12</property>
+                        <property name="halign">center</property>
+                        <property name="action-name">collection-action.create-collection</property>
+                        <style>
+                          <class name="suggested-action"/>
+                          <class name="pill-button"/>
+                        </style>
                       </object>
                     </child>
-                    <style>
-                      <class name="suggested-action"/>
-                      <class name="pill-button"/>
-                    </style>
                   </object>
                 </child>
               </object>
diff --git a/src/ui/collection-action-window.vala b/src/ui/collection-action-window.vala
index 00b31b28..15ad6272 100644
--- a/src/ui/collection-action-window.vala
+++ b/src/ui/collection-action-window.vala
@@ -15,7 +15,7 @@ private class Games.CollectionActionWindow : Hdy.Window {
        [GtkChild]
        private Gtk.ScrolledWindow list_page;
        [GtkChild]
-       private Gtk.Box empty_page;
+       private Hdy.StatusPage empty_page;
        [GtkChild]
        private Gtk.Entry name_entry;
        [GtkChild]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]