[gnome-software/1392-unify-lozenge-styling: 7/13] gs-storage-context-dialog: Use GsLozenge




commit 78a827d7af8ddd0a563ff08f0e8498b26c01f539
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 3 20:46:17 2022 +0200

    gs-storage-context-dialog: Use GsLozenge

 src/gs-storage-context-dialog.c  |  5 ++---
 src/gs-storage-context-dialog.ui | 20 +++++---------------
 2 files changed, 7 insertions(+), 18 deletions(-)
---
diff --git a/src/gs-storage-context-dialog.c b/src/gs-storage-context-dialog.c
index 4699f5c65..73ceff0bc 100644
--- a/src/gs-storage-context-dialog.c
+++ b/src/gs-storage-context-dialog.c
@@ -38,6 +38,7 @@
 #include "gs-app.h"
 #include "gs-common.h"
 #include "gs-context-dialog-row.h"
+#include "gs-lozenge.h"
 #include "gs-storage-context-dialog.h"
 
 struct _GsStorageContextDialog
@@ -48,7 +49,6 @@ struct _GsStorageContextDialog
        gulong                   app_notify_handler;
 
        GtkSizeGroup            *lozenge_size_group;
-       GtkLabel                *lozenge_content;
        GtkWidget               *lozenge;
        GtkLabel                *title;
        GtkListBox              *sizes_list;
@@ -171,7 +171,7 @@ update_sizes_list (GsStorageContextDialog *self)
        }
 
        title_size_bytes_str = g_format_size (title_size_bytes);
-       gtk_label_set_text (self->lozenge_content, title_size_bytes_str);
+       gs_lozenge_set_text (GS_LOZENGE (self->lozenge), title_size_bytes_str);
        gtk_label_set_text (self->title, title);
 
        /* Update the Manage Storage label. */
@@ -313,7 +313,6 @@ gs_storage_context_dialog_class_init (GsStorageContextDialogClass *klass)
        gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/Software/gs-storage-context-dialog.ui");
 
        gtk_widget_class_bind_template_child (widget_class, GsStorageContextDialog, lozenge_size_group);
-       gtk_widget_class_bind_template_child (widget_class, GsStorageContextDialog, lozenge_content);
        gtk_widget_class_bind_template_child (widget_class, GsStorageContextDialog, lozenge);
        gtk_widget_class_bind_template_child (widget_class, GsStorageContextDialog, title);
        gtk_widget_class_bind_template_child (widget_class, GsStorageContextDialog, sizes_list);
diff --git a/src/gs-storage-context-dialog.ui b/src/gs-storage-context-dialog.ui
index 4b3de96c0..de2f589c8 100644
--- a/src/gs-storage-context-dialog.ui
+++ b/src/gs-storage-context-dialog.ui
@@ -23,25 +23,15 @@
                     <property name="spacing">12</property>
 
                     <child>
-                      <object class="GtkBox" id="lozenge">
-                        <property name="halign">center</property>
+                      <object class="GsLozenge" id="lozenge">
+                        <property name="circular">False</property>
                         <style>
-                          <class name="context-tile-lozenge"/>
                           <class name="large"/>
                           <class name="grey"/>
                         </style>
-                        <child>
-                          <object class="GtkLabel" id="lozenge_content">
-                            <property name="halign">center</property>
-                            <property name="hexpand">True</property>
-                            <!-- this is a placeholder: the text is actually set in code -->
-                            <property name="label">20 MB</property>
-                            <property name="xalign">0.5</property>
-                            <accessibility>
-                              <relation name="labelled-by">title</relation>
-                            </accessibility>
-                          </object>
-                        </child>
+                        <accessibility>
+                          <relation name="labelled-by">title</relation>
+                        </accessibility>
                       </object>
                     </child>
 


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