[gnome-software/1392-unify-lozenge-styling: 8/14] gs-hardware-support-context-dialog: Use GsLozenge




commit 82fa98b15052e8e10d4a9423ee923659b4b51145
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 3 20:47:06 2022 +0200

    gs-hardware-support-context-dialog: Use GsLozenge

 src/gs-hardware-support-context-dialog.c  |  5 ++---
 src/gs-hardware-support-context-dialog.ui | 23 ++++++++---------------
 2 files changed, 10 insertions(+), 18 deletions(-)
---
diff --git a/src/gs-hardware-support-context-dialog.c b/src/gs-hardware-support-context-dialog.c
index e10d0c49a..c1a4d60c5 100644
--- a/src/gs-hardware-support-context-dialog.c
+++ b/src/gs-hardware-support-context-dialog.c
@@ -40,6 +40,7 @@
 #include "gs-common.h"
 #include "gs-context-dialog-row.h"
 #include "gs-hardware-support-context-dialog.h"
+#include "gs-lozenge.h"
 
 struct _GsHardwareSupportContextDialog
 {
@@ -49,7 +50,6 @@ struct _GsHardwareSupportContextDialog
        gulong                   app_notify_handler_relations;
        gulong                   app_notify_handler_name;
 
-       GtkImage                *icon;
        GtkWidget               *lozenge;
        GtkLabel                *title;
        GtkListBox              *relations_list;
@@ -722,7 +722,7 @@ update_relations_list (GsHardwareSupportContextDialog *self)
                g_assert_not_reached ();
        }
 
-       gtk_image_set_from_icon_name (GTK_IMAGE (self->icon), icon_name);
+       gs_lozenge_set_icon_name (GS_LOZENGE (self->lozenge), icon_name);
        gtk_label_set_text (self->title, title);
 
        context = gtk_widget_get_style_context (self->lozenge);
@@ -826,7 +826,6 @@ gs_hardware_support_context_dialog_class_init (GsHardwareSupportContextDialogCla
 
        gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/Software/gs-hardware-support-context-dialog.ui");
 
-       gtk_widget_class_bind_template_child (widget_class, GsHardwareSupportContextDialog, icon);
        gtk_widget_class_bind_template_child (widget_class, GsHardwareSupportContextDialog, lozenge);
        gtk_widget_class_bind_template_child (widget_class, GsHardwareSupportContextDialog, title);
        gtk_widget_class_bind_template_child (widget_class, GsHardwareSupportContextDialog, relations_list);
diff --git a/src/gs-hardware-support-context-dialog.ui b/src/gs-hardware-support-context-dialog.ui
index 65fa0ee4d..5ce7a72b0 100644
--- a/src/gs-hardware-support-context-dialog.ui
+++ b/src/gs-hardware-support-context-dialog.ui
@@ -23,25 +23,18 @@
                     <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>
+                        <!-- this is a placeholder: the icon is actually set in code -->
+                        <property name="icon-name">safety-symbolic</property>
+                        <property name="pixel-size">24</property>
                         <style>
-                          <class name="context-tile-lozenge"/>
                           <class name="large"/>
                           <class name="grey"/>
                         </style>
-                        <child>
-                          <object class="GtkImage" id="icon">
-                            <property name="halign">center</property>
-                            <property name="hexpand">True</property>
-                            <!-- this is a placeholder: the icon is actually set in code -->
-                            <property name="icon-name">safety-symbolic</property>
-                            <property name="pixel-size">24</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]