[gnome-control-center/gbsneto/applications-panel-cleanups: 9/19] applications: Set subtitle of storage row




commit ea30e057e44f60fd24606b46469f87bb11264172
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Jan 20 13:31:01 2022 -0300

    applications: Set subtitle of storage row
    
    Set the subtitle of the storage row, instead of the secondary
    label, as per latest designs.

 panels/applications/cc-applications-panel.c  | 6 +++++-
 panels/applications/cc-applications-panel.ui | 1 -
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/panels/applications/cc-applications-panel.c b/panels/applications/cc-applications-panel.c
index 567186e61..ea2ddaf3d 100644
--- a/panels/applications/cc-applications-panel.c
+++ b/panels/applications/cc-applications-panel.c
@@ -1487,12 +1487,16 @@ static void
 update_total_size (CcApplicationsPanel *self)
 {
   g_autofree gchar *formatted_size = NULL;
+  g_autofree gchar *subtitle = NULL;
   guint64 total;
 
   total = self->app_size + self->data_size + self->cache_size;
   formatted_size = g_format_size (total);
   g_object_set (self->total, "info", formatted_size, NULL);
-  g_object_set (self->storage, "info", formatted_size, NULL);
+
+  /* Translators: '%s' is the formatted size, e.g. "26.2 MB" */
+  subtitle = g_strdup_printf (_("%s of disk space used"), formatted_size);
+  g_object_set (self->storage, "subtitle", subtitle, NULL);
 }
 
 static void
diff --git a/panels/applications/cc-applications-panel.ui b/panels/applications/cc-applications-panel.ui
index b2a76e68b..a96afd18e 100644
--- a/panels/applications/cc-applications-panel.ui
+++ b/panels/applications/cc-applications-panel.ui
@@ -261,7 +261,6 @@
                     <child>
                       <object class="CcInfoRow" id="storage">
                         <property name="title" translatable="yes">Storage</property>
-                        <property name="info">unknown</property>
                         <property name="has-expander">1</property>
                         <property name="is-link">1</property>
                       </object>


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