[gnome-software] trivial: Fix the spacing of the webapp warning on the details page



commit d092ba071f4dc74c2b9350d8d0662cf7cd57412d
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jul 13 14:18:32 2016 +0100

    trivial: Fix the spacing of the webapp warning on the details page

 src/gs-shell-details.c  |   22 +++++++++++++---------
 src/gs-shell-details.ui |   21 ---------------------
 src/gtk-style.css       |    4 ++++
 3 files changed, 17 insertions(+), 30 deletions(-)
---
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 83b710b..6456c4b 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -107,7 +107,6 @@ struct _GsShellDetails
        GtkWidget               *label_details_version_value;
        GtkWidget               *label_failed;
        GtkWidget               *label_pending;
-       GtkWidget               *label_details_webapp;
        GtkWidget               *label_license_nonfree_details;
        GtkWidget               *label_licenses_intro;
        GtkWidget               *list_box_addons;
@@ -673,6 +672,19 @@ gs_shell_details_set_description (GsShellDetails *self, const gchar *tmp)
 
                gtk_box_pack_start (GTK_BOX (self->box_details_description), para, FALSE, FALSE, 0);
        }
+
+       /* show the webapp warning */
+       if (gs_app_get_kind (self->app) == AS_APP_KIND_WEB_APP) {
+               GtkWidget *label;
+               /* TRANSLATORS: this is the warning box */
+               label = gtk_label_new ("This application can only be used when there is an active internet 
connection.");
+               gtk_widget_set_visible (label, TRUE);
+               gtk_label_set_xalign (GTK_LABEL (label), 0.f);
+               gtk_style_context_add_class (gtk_widget_get_style_context (label),
+                                            "application-details-webapp-warning");
+               gtk_box_pack_start (GTK_BOX (self->box_details_description),
+                                   label, FALSE, FALSE, 0);
+       }
 }
 
 static void
@@ -916,13 +928,6 @@ gs_shell_details_refresh_all (GsShellDetails *self)
        gtk_widget_set_sensitive (self->image_details_kudo_integration, ret);
        gs_shell_details_set_sensitive (self->label_details_kudo_integration, ret);
 
-       /* show the webapp warning */
-       if (gs_app_get_kind (self->app) == AS_APP_KIND_WEB_APP) {
-               gtk_widget_set_visible (self->label_details_webapp, TRUE);
-       } else {
-               gtk_widget_set_visible (self->label_details_webapp, FALSE);
-       }
-
        /* hide the kudo details for non-desktop software */
        switch (gs_app_get_kind (self->app)) {
        case AS_APP_KIND_DESKTOP:
@@ -1967,7 +1972,6 @@ gs_shell_details_class_init (GsShellDetailsClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_version_value);
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_failed);
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_pending);
-       gtk_widget_class_bind_template_child (widget_class, GsShellDetails, label_details_webapp);
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, list_box_addons);
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_reviews);
        gtk_widget_class_bind_template_child (widget_class, GsShellDetails, box_details_screenshot_fallback);
diff --git a/src/gs-shell-details.ui b/src/gs-shell-details.ui
index 9d5e19b..17ccca1 100644
--- a/src/gs-shell-details.ui
+++ b/src/gs-shell-details.ui
@@ -493,27 +493,6 @@
                             <property name="position">4</property>
                           </packing>
                         </child>
-
-                        <child>
-                          <object class="GtkLabel" id="label_details_webapp">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="halign">start</property>
-                            <property name="valign">start</property>
-                            <property name="margin_top">10</property>
-                            <property name="label" translatable="yes" comments="this is the warning 
box">This application can only be used when there is an active internet connection.</property>
-                            <property name="xalign">0</property>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                            </attributes>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">5</property>
-                          </packing>
-                        </child>
-
                         <child>
                           <object class="GsInfoBar" id="infobar_details_app_repo">
                             <property name="visible">True</property>
diff --git a/src/gtk-style.css b/src/gtk-style.css
index 850bbe4..94582e7 100644
--- a/src/gtk-style.css
+++ b/src/gtk-style.css
@@ -203,6 +203,10 @@
        font-size: 125%;
 }
 
+.application-details-webapp-warning {
+       font-weight: bold;
+}
+
 .application-details-summary {
 }
 


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