[gnome-software: 3/4] updates-page: Improve the "updates loading" page style




commit eea6f54472eb4c903b8d2ffabc41d8665b78f680
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Jun 17 09:46:48 2021 +0200

    updates-page: Improve the "updates loading" page style
    
    This better implement the HdyStatusPage style for the updates loading
    state, splitting the page's title and its description in two strings,
    using the title case for the title and making the description a proper
    sentence.
    
    This also drops gs_updates_page_get_state_string() as it's only used to
    get a localized static string, making the code simpler and more
    consistent.

 src/gs-updates-page.c  | 24 ++++++------------------
 src/gs-updates-page.ui | 34 ++++++++++++++++++++++++----------
 2 files changed, 30 insertions(+), 28 deletions(-)
---
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 0f1b2567a..2233e22b1 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -186,13 +186,6 @@ gs_updates_page_last_checked_time_string (GsUpdatesPage *self)
        return gs_utils_time_to_string (last_checked);
 }
 
-static const gchar *
-gs_updates_page_get_state_string (GsPluginStatus status)
-{
-       /* TRANSLATORS: the update panel is doing *something* vague */
-       return _("Looking for new updates…");
-}
-
 static void
 refresh_headerbar_updates_counter (GsUpdatesPage *self)
 {
@@ -215,7 +208,6 @@ gs_updates_page_update_ui_state (GsUpdatesPage *self)
 {
        gboolean allow_mobile_refresh = TRUE;
        g_autofree gchar *checked_str = NULL;
-       g_autofree gchar *spinner_str = NULL;
 
        if (gs_shell_get_mode (self->shell) != GS_SHELL_MODE_UPDATES)
                return;
@@ -246,18 +238,14 @@ gs_updates_page_update_ui_state (GsUpdatesPage *self)
        /* spinner text */
        switch (self->state) {
        case GS_UPDATES_PAGE_STATE_STARTUP:
-               spinner_str = g_strdup_printf ("%s\n%s",
-                                      /* TRANSLATORS: the updates panel is starting up */
-                                      _("Setting up updates…"),
-                                      _("(This could take a while)"));
-               gtk_label_set_label (GTK_LABEL (self->label_updates_spinner), spinner_str);
+               gtk_label_set_label (GTK_LABEL (self->label_updates_spinner),
+                                    /* TRANSLATORS: the updates panel is starting up */
+                                    _("Setting Up Updates…"));
                break;
        case GS_UPDATES_PAGE_STATE_ACTION_REFRESH:
-               spinner_str = g_strdup_printf ("%s\n%s",
-                                      gs_updates_page_get_state_string (self->last_status),
-                                      /* TRANSLATORS: the updates panel is starting up */
-                                      _("(This could take a while)"));
-               gtk_label_set_label (GTK_LABEL (self->label_updates_spinner), spinner_str);
+               gtk_label_set_label (GTK_LABEL (self->label_updates_spinner),
+                                    /* TRANSLATORS: the update panel is doing *something* vague */
+                                    _("Looking for New Updates…"));
                break;
        default:
                break;
diff --git a/src/gs-updates-page.ui b/src/gs-updates-page.ui
index 38350e395..868a1b1c4 100644
--- a/src/gs-updates-page.ui
+++ b/src/gs-updates-page.ui
@@ -68,35 +68,49 @@
             <child>
               <object class="HdyClamp">
                 <property name="visible">True</property>
+                <property name="valign">center</property>
+                <style>
+                  <class name="status-page"/>
+                </style>
                 <child>
                   <object class="GtkBox">
                     <property name="visible">True</property>
                     <property name="orientation">vertical</property>
-                    <property name="spacing">36</property>
-                    <property name="halign">center</property>
                     <property name="valign">center</property>
-                    <property name="hexpand">True</property>
-                    <property name="vexpand">True</property>
                     <child>
                       <object class="GtkSpinner" id="spinner_updates">
                         <property name="visible">True</property>
-                        <property name="width_request">128</property>
-                        <property name="height_request">128</property>
-                        <property name="halign">center</property>
-                        <property name="valign">center</property>
-                        <property name="hexpand">True</property>
-                        <property name="vexpand">True</property>
+                        <style>
+                          <class name="icon"/>
+                        </style>
                       </object>
                     </child>
                     <child>
                       <object class="GtkLabel" id="label_updates_spinner">
                         <property name="visible">True</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="visible">True</property>
+                        <property name="wrap">True</property>
+                        <property name="wrap-mode">word-char</property>
+                        <property name="justify">center</property>
+                        <property name="use-markup">True</property>
+                        <property name="label" translatable="yes" comments="TRANSLATORS: the updates panel 
is starting up.">This could take a while.</property>
+                        <style>
+                          <class name="body"/>
+                          <class name="description"/>
+                        </style>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>


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