[gnome-characters/bilelmoussaoui/ui-cleanup: 6/8] make use of HdyStatusPage




commit 0312dbb6a5954100cfaa7601c0d2bf5cb69479af
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Fri Feb 12 00:30:54 2021 +0100

    make use of HdyStatusPage

 data/characterlist.ui | 95 +++++++++++++++------------------------------------
 data/mainview.ui      | 47 ++++---------------------
 data/mainwindow.ui    |  1 -
 3 files changed, 34 insertions(+), 109 deletions(-)
---
diff --git a/data/characterlist.ui b/data/characterlist.ui
index 8ceb53e..060245b 100644
--- a/data/characterlist.ui
+++ b/data/characterlist.ui
@@ -4,81 +4,42 @@
   <template class="Gjs_CharacterListView" parent="GtkStack">
     <property name="visible">True</property>
     <child>
-      <object class="GtkGrid" id="unavailable-grid">
-       <property name="can_focus">False</property>
-       <property name="visible">False</property>
-       <property name="orientation">vertical</property>
-       <property name="halign">center</property>
-       <property name="valign">center</property>
-       <style>
-         <class name="banner"/>
-       </style>
-       <child>
-         <object class="GtkImage" id="unavailable-image">
-           <property name="can_focus">False</property>
-           <property name="visible">True</property>
-           <property name="halign">center</property>
-           <property name="pixel_size">128</property>
-           <property name="icon_name">action-unavailable-symbolic</property>
-         </object>
-       </child>
-       <child>
-         <object class="GtkLabel" id="unavailable-label">
-           <property name="can_focus">False</property>
-           <property name="visible">True</property>
-           <property name="halign">center</property>
-           <property name="label" translatable="yes">Search found no results</property>
-           <style>
-             <class name="banner-label"/>
-           </style>
-         </object>
-       </child>
-       <child>
-         <object class="GtkLabel" id="unavailable-hint">
-           <property name="can_focus">False</property>
-           <property name="visible">True</property>
-           <property name="halign">center</property>
-           <property name="label" translatable="yes">Try a different search.</property>
-           <style>
-             <class name="banner-hint"/>
-           </style>
-         </object>
-       </child>
+      <object class="HdyStatusPage">
+        <property name="icon-name">system-search-symbolic</property>
+        <property name="title" translatable="yes">No Results</property>
+        <property name="description" translatable="yes">Try a different search.</property>
       </object>
       <packing>
-       <property name="name">unavailable</property>
+        <property name="name">unavailable</property>
       </packing>
     </child>
     <child>
       <object class="GtkGrid" id="loading-grid">
-       <property name="can_focus">False</property>
-       <property name="visible">False</property>
-       <property name="halign">center</property>
-       <property name="valign">center</property>
-       <style>
-         <class name="banner"/>
-       </style>
-       <child>
-         <object class="GtkSpinner" id="loading-spinner">
-           <property name="can_focus">False</property>
-           <property name="visible">True</property>
-           <property name="width-request">128</property>
-           <property name="height-request">128</property>
-         </object>
-       </child>
-       <child>
-         <object class="GtkLabel" id="loading-label">
-           <property name="can_focus">False</property>
-           <property name="visible">True</property>
-           <property name="label" translatable="yes">Loading…</property>
-           <style>
-             <class name="banner-label"/>
-           </style>
-         </object>
-       </child>
+        <property name="visible">False</property>
+        <property name="halign">center</property>
+        <property name="valign">center</property>
+        <style>
+          <class name="banner"/>
+        </style>
+        <child>
+          <object class="GtkSpinner" id="loading-spinner">
+            <property name="visible">True</property>
+            <property name="width-request">128</property>
+            <property name="height-request">128</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="loading-label">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Loading…</property>
+            <style>
+              <class name="banner-label"/>
+            </style>
+          </object>
+        </child>
       </object>
       <packing>
-       <property name="name">loading</property>
+        <property name="name">loading</property>
       </packing>
     </child>
   </template>
diff --git a/data/mainview.ui b/data/mainview.ui
index 6ab2f2a..41f133b 100644
--- a/data/mainview.ui
+++ b/data/mainview.ui
@@ -4,49 +4,14 @@
   <template class="Gjs_MainView" parent="GtkStack">
     <property name="visible">True</property>
     <child>
-      <object class="GtkGrid" id="empty-recent-grid">
-       <property name="can_focus">False</property>
-       <property name="visible">False</property>
-       <property name="orientation">vertical</property>
-       <property name="halign">center</property>
-       <property name="valign">center</property>
-       <style>
-         <class name="banner"/>
-       </style>
-       <child>
-         <object class="GtkImage" id="empty-recent-image">
-           <property name="can_focus">False</property>
-           <property name="visible">True</property>
-           <property name="halign">center</property>
-           <property name="pixel_size">128</property>
-           <property name="icon_name">characters-punctuation-symbolic</property>
-         </object>
-       </child>
-       <child>
-         <object class="GtkLabel" id="empty-recent-label">
-           <property name="can_focus">False</property>
-           <property name="visible">True</property>
-           <property name="halign">center</property>
-           <property name="label" translatable="yes">No recent characters found</property>
-           <style>
-             <class name="banner-label"/>
-           </style>
-         </object>
-       </child>
-       <child>
-         <object class="GtkLabel" id="empty-recent-hint">
-           <property name="can_focus">False</property>
-           <property name="visible">True</property>
-           <property name="halign">center</property>
-           <property name="label" translatable="yes">Characters will appear here if you use them.</property>
-           <style>
-             <class name="banner-hints"/>
-           </style>
-         </object>
-       </child>
+      <object class="HdyStatusPage">
+        <property name="visible">True</property>
+        <property name="icon_name">characters-punctuation-symbolic</property>
+        <property name="title" translatable="yes">No Recent Characters</property>
+        <property name="description" translatable="yes">Characters will appear here if you use 
them.</property>
       </object>
       <packing>
-       <property name="name">empty-recent</property>
+        <property name="name">empty-recent</property>
       </packing>
     </child>
   </template>
diff --git a/data/mainwindow.ui b/data/mainwindow.ui
index 45edc60..d476af1 100644
--- a/data/mainwindow.ui
+++ b/data/mainwindow.ui
@@ -99,7 +99,6 @@
                 <property name="visible">True</property>
                 <property name="show-close-button">True</property>
                 <property name="has-subtitle">False</property>
-                <property name="title" translatable="yes">Current page</property>
                 <child>
                   <object class="GtkButton" id="back-button">
                     <property name="can_focus">True</property>


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