[gnome-software: 2/3] loading-page: Use HdyStatusPage




commit 9d89003dd81f519e0a37cab484d2eafd014a7161
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Jun 8 14:39:30 2021 +0200

    loading-page: Use HdyStatusPage
    
    This makes the code a bit simpler and ensure it will stay in line with
    the latest design changes.

 src/gs-loading-page.c  | 10 +++++-----
 src/gs-loading-page.ui | 35 +++++------------------------------
 2 files changed, 10 insertions(+), 35 deletions(-)
---
diff --git a/src/gs-loading-page.c b/src/gs-loading-page.c
index 508f574ea..82fb9ff91 100644
--- a/src/gs-loading-page.c
+++ b/src/gs-loading-page.c
@@ -22,7 +22,7 @@ typedef struct {
        GsShell                 *shell;
 
        GtkWidget               *progressbar;
-       GtkWidget               *label;
+       GtkWidget               *status_page;
        guint                    progress_pulse_id;
 } GsLoadingPagePrivate;
 
@@ -53,7 +53,7 @@ gs_loading_page_status_changed_cb (GsPluginLoader *plugin_loader,
        GsLoadingPagePrivate *priv = gs_loading_page_get_instance_private (self);
        const gchar *str = NULL;
 
-       /* update label */
+       /* update title */
        if (status == GS_PLUGIN_STATUS_DOWNLOADING) {
                if (app != NULL)
                        str = gs_app_get_summary_missing (app);
@@ -66,8 +66,8 @@ gs_loading_page_status_changed_cb (GsPluginLoader *plugin_loader,
                str = _("Software catalog is being downloaded");
        }
 
-       /* update label */
-       gtk_label_set_label (GTK_LABEL (priv->label), str);
+       /* update title */
+       hdy_status_page_set_title (HDY_STATUS_PAGE (priv->status_page), str);
 
        /* update progresbar */
        if (app != NULL) {
@@ -215,7 +215,7 @@ gs_loading_page_class_init (GsLoadingPageClass *klass)
        gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-loading-page.ui");
 
        gtk_widget_class_bind_template_child_private (widget_class, GsLoadingPage, progressbar);
-       gtk_widget_class_bind_template_child_private (widget_class, GsLoadingPage, label);
+       gtk_widget_class_bind_template_child_private (widget_class, GsLoadingPage, status_page);
 }
 
 static void
diff --git a/src/gs-loading-page.ui b/src/gs-loading-page.ui
index 5b57e1b3f..e68969f0b 100644
--- a/src/gs-loading-page.ui
+++ b/src/gs-loading-page.ui
@@ -8,32 +8,16 @@
       </object>
     </child>
     <child>
-      <object class="GtkBox" id="box">
+      <object class="HdyStatusPage" id="status_page">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">48</property>
-        <property name="hexpand">True</property>
-        <property name="vexpand">True</property>
-        <child type="center">
-          <object class="GtkBox" id="centerbox">
+        <property name="icon_name">org.gnome.Software</property>
+        <property name="title" translatable="yes">Starting up…</property>
+        <child>
+          <object class="HdyClamp">
             <property name="visible">True</property>
-            <property name="orientation">vertical</property>
-            <property name="spacing">12</property>
-            <child>
-              <object class="GtkImage" id="image">
-                <property name="visible">True</property>
-                <property name="pixel_size">192</property>
-                <property name="icon_name">org.gnome.Software</property>
-                <style>
-                  <class name="icon-dropshadow"/>
-                </style>
-              </object>
-            </child>
             <child>
               <object class="GtkProgressBar" id="progressbar">
                 <property name="visible">True</property>
-                <property name="width_request">480</property>
-                <property name="halign">center</property>
                 <property name="fraction">0.0</property>
                 <property name="margin_top">20</property>
                 <property name="margin_bottom">12</property>
@@ -42,15 +26,6 @@
                 </style>
               </object>
             </child>
-            <child>
-              <object class="GtkLabel" id="label">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">Starting up…</property>
-                <attributes>
-                  <attribute name="scale" value="1.4"/>
-                </attributes>
-              </object>
-            </child>
           </object>
         </child>
       </object>


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