[gnome-software: 13/18] gs-details-page: Move application developer name




commit 20e14695f0f7ebbf35e422dee85038fe9e8e110a
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Jul 26 16:50:59 2021 +0100

    gs-details-page: Move application developer name
    
    Move it to the top of the details page, as in the new designs:
    https://gitlab.gnome.org/Teams/Design/software-mockups/-/raw/master/adaptive/app-page-adaptive.png.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1111, #1285

 src/gs-details-page.c  | 25 ++++++----------
 src/gs-details-page.ui | 78 ++++++++++++++++++++------------------------------
 2 files changed, 39 insertions(+), 64 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index b7b0eec88..0d1318955 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -119,10 +119,8 @@ struct _GsDetailsPage
        GtkWidget               *label_progress_status;
        GtkWidget               *label_addons_uninstalled_app;
        GsAppContextBar         *context_bar;
-       GtkWidget               *label_details_developer_title;
-       GtkWidget               *label_details_developer_value;
-       GtkWidget               *box_details_developer;
-       GtkWidget               *image_details_developer_verified;
+       GtkLabel                *developer_name_label;
+       GtkImage                *developer_verified_image;
        GtkWidget               *label_failed;
        GtkWidget               *list_box_addons;
        GtkWidget               *list_box_version_history;
@@ -1062,15 +1060,10 @@ gs_details_page_refresh_all (GsDetailsPage *self)
        tmp = gs_app_get_developer_name (self->app);
        if (tmp == NULL)
                tmp = gs_app_get_project_group (self->app);
-       if (tmp == NULL) {
-               gtk_widget_set_visible (self->label_details_developer_title, FALSE);
-               gtk_widget_set_visible (self->box_details_developer, FALSE);
-       } else {
-               gtk_widget_set_visible (self->label_details_developer_title, TRUE);
-               gtk_label_set_label (GTK_LABEL (self->label_details_developer_value), tmp);
-               gtk_widget_set_visible (self->box_details_developer, TRUE);
-       }
-       gtk_widget_set_visible (self->image_details_developer_verified, gs_app_has_quirk (self->app, 
GS_APP_QUIRK_DEVELOPER_VERIFIED));
+       if (tmp != NULL)
+               gtk_label_set_label (GTK_LABEL (self->developer_name_label), tmp);
+       gtk_widget_set_visible (GTK_WIDGET (self->developer_name_label), tmp != NULL);
+       gtk_widget_set_visible (GTK_WIDGET (self->developer_verified_image), gs_app_has_quirk (self->app, 
GS_APP_QUIRK_DEVELOPER_VERIFIED));
 
        /* set version history */
        version_history = gs_app_get_version_history (self->app);
@@ -2308,10 +2301,8 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, context_bar);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_progress_percentage);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_progress_status);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_developer_title);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_developer_value);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_details_developer);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_developer_verified);
+       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, developer_name_label);
+       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, developer_verified_image);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_failed);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, list_box_addons);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, list_box_version_history);
diff --git a/src/gs-details-page.ui b/src/gs-details-page.ui
index 998e980d2..24b826c5c 100644
--- a/src/gs-details-page.ui
+++ b/src/gs-details-page.ui
@@ -112,6 +112,37 @@
                                     </style>
                                   </object>
                                 </child>
+                                <child>
+                                  <object class="GtkBox">
+                                    <property name="visible" bind-source="developer_name_label" 
bind-property="visible" bind-flags="sync-create"/>
+                                    <property name="hexpand">True</property>
+                                    <property name="spacing">3</property>
+                                    <property name="orientation">horizontal</property>
+                                    <child>
+                                      <object class="GtkLabel" id="developer_name_label">
+                                        <property name="visible">True</property>
+                                        <!-- This is a placeholder; the real value is set in code -->
+                                        <property name="label">Yorba</property>
+                                        <property name="wrap">False</property>
+                                        <property name="selectable">True</property>
+                                        <property name="max-width-chars">100</property>
+                                        <property name="xalign">0</property>
+                                        <property name="yalign">0.5</property>
+                                        <property name="hexpand">False</property>
+                                        <style>
+                                          <class name="dim-label"/>
+                                        </style>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkImage" id="developer_verified_image">
+                                        <property name="visible">True</property>
+                                        <property name="pixel-size">16</property>
+                                        <property name="icon-name">emblem-ok-symbolic</property>
+                                      </object>
+                                    </child>
+                                  </object>
+                                </child>
                               </object>
                             </child>
 
@@ -809,53 +840,6 @@
                                 <property name="column_spacing">24</property>
                                 <property name="hexpand">True</property>
                                 <property name="valign">start</property>
-
-                                <child>
-                                  <object class="GtkLabel" id="label_details_developer_title">
-                                    <property name="visible">True</property>
-                                    <property name="label" translatable="yes">Developer</property>
-                                    <property name="xalign">0</property>
-                                    <property name="yalign">0.5</property>
-                                    <property name="vexpand">True</property>
-                                    <style>
-                                      <class name="dim-label"/>
-                                    </style>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">0</property>
-                                    <property name="top_attach">6</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkBox" id="box_details_developer">
-                                    <property name="visible">True</property>
-                                    <property name="hexpand">True</property>
-                                    <property name="spacing">3</property>
-                                    <child>
-                                      <object class="GtkLabel" id="label_details_developer_value">
-                                        <property name="visible">True</property>
-                                        <property name="label">Yorba</property>
-                                        <property name="wrap">True</property>
-                                        <property name="selectable">True</property>
-                                        <property name="max_width_chars">100</property>
-                                        <property name="xalign">0</property>
-                                        <property name="yalign">0.5</property>
-                                        <property name="hexpand">False</property>
-                                      </object>
-                                    </child>
-                                    <child>
-                                      <object class="GtkImage" id="image_details_developer_verified">
-                                        <property name="visible">True</property>
-                                        <property name="pixel_size">16</property>
-                                        <property name="icon_name">emblem-ok-symbolic</property>
-                                      </object>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="top_attach">6</property>
-                                  </packing>
-                                </child>
                               </object>
                             </child>
                           </object>


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