[gnome-software/wip/exalm/style-cleanups: 20/27] updates-page: Clean up the eol banner




commit 0ac09dd02833a817b47eaeeb6474e3b99d9b7078
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Nov 9 22:36:23 2021 +0500

    updates-page: Clean up the eol banner
    
    Make it a regular GtkInfoBar instead of essentially reimplementing it along
    with its pre-3.32 style.

 src/gs-updates-page.c  |  8 ++++----
 src/gs-updates-page.ui | 22 +---------------------
 src/style.css          |  6 ------
 3 files changed, 5 insertions(+), 31 deletions(-)
---
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 6c286717b..a1fc5816d 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -74,7 +74,7 @@ struct _GsUpdatesPage
        GtkWidget               *spinner_updates;
        GtkWidget               *stack_updates;
        GtkWidget               *upgrade_banner;
-       GtkWidget               *box_end_of_life;
+       GtkWidget               *infobar_end_of_life;
        GtkWidget               *label_end_of_life;
 
        GtkSizeGroup            *sizegroup_image;
@@ -562,7 +562,7 @@ gs_updates_page_refine_system_finished_cb (GObject *source_object,
 
        /* show or hide the end of life notification */
        if (gs_app_get_state (app) != GS_APP_STATE_UNAVAILABLE) {
-               gtk_widget_set_visible (self->box_end_of_life, FALSE);
+               gtk_info_bar_set_revealed (GTK_INFO_BAR (self->infobar_end_of_life), FALSE);
                return;
        }
 
@@ -587,7 +587,7 @@ gs_updates_page_refine_system_finished_cb (GObject *source_object,
        g_string_append (str, _("It is recommended that you upgrade to a more recent version."));
 
        gtk_label_set_label (GTK_LABEL (self->label_end_of_life), str->str);
-       gtk_widget_set_visible (self->box_end_of_life, TRUE);
+       gtk_info_bar_set_revealed (GTK_INFO_BAR (self->infobar_end_of_life), TRUE);
 
 }
 
@@ -1463,7 +1463,7 @@ gs_updates_page_class_init (GsUpdatesPageClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, spinner_updates);
        gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, stack_updates);
        gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, upgrade_banner);
-       gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, box_end_of_life);
+       gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, infobar_end_of_life);
        gtk_widget_class_bind_template_child (widget_class, GsUpdatesPage, label_end_of_life);
 }
 
diff --git a/src/gs-updates-page.ui b/src/gs-updates-page.ui
index 5d12c6779..c62942c86 100644
--- a/src/gs-updates-page.ui
+++ b/src/gs-updates-page.ui
@@ -9,30 +9,13 @@
       <object class="GtkBox">
         <property name="orientation">vertical</property>
         <child>
-          <object class="GtkBox" id="box_end_of_life">
-            <property name="visible">False</property>
-            <property name="orientation">horizontal</property>
-            <property name="spacing">18</property>
-            <style>
-              <class name="eol-box"/>
-            </style>
-            <child>
-              <object class="GtkImage">
-                <property name="pixel_size">16</property>
-                <property name="icon_name">dialog-warning-symbolic</property>
-                <property name="margin_top">18</property>
-                <property name="margin_start">18</property>
-                <property name="valign">start</property>
-              </object>
-            </child>
+          <object class="GtkInfoBar" id="infobar_end_of_life">
             <child>
               <object class="GtkBox">
                 <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkLabel">
-                    <property name="margin_end">18</property>
-                    <property name="margin_top">18</property>
                     <property name="label" translatable="yes">Operating System Updates Unavailable</property>
                     <property name="xalign">0</property>
                     <attributes>
@@ -42,11 +25,8 @@
                 </child>
                 <child>
                   <object class="GtkLabel" id="label_end_of_life">
-                    <property name="margin_end">18</property>
-                    <property name="margin_bottom">18</property>
                     <property name="label">Your OS is no longer supported. This means that it does not 
receive security updates. It is recommended that you upgrade to a more recent version.</property>
                     <property name="wrap">True</property>
-                    <property name="width_chars">80</property>
                     <property name="xalign">0</property>
                   </object>
                 </child>
diff --git a/src/style.css b/src/style.css
index 504346171..c92024b46 100644
--- a/src/style.css
+++ b/src/style.css
@@ -306,12 +306,6 @@ star-image {
        padding-right: 16px;
 }
 
-.eol-box {
-       background-color: @accent_bg_color;
-       border: 1px solid shade(@accent_bg_color, 0.8);
-       color: @accent_fg_color;
-}
-
 .featured-carousel carousel {
        border-radius: 8px;
 }


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