[gnome-software: 7/18] gs-details-page: Drop kudos grid




commit 62361c531182a788eca0880772fa8c4f5ec0dfcc
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Jul 26 15:48:52 2021 +0100

    gs-details-page: Drop kudos grid
    
    It’s now covered by the app context bar.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1111

 src/gs-details-page.c  |  67 -----------------------------
 src/gs-details-page.ui | 111 -------------------------------------------------
 2 files changed, 178 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index b68326125..d828ee453 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -142,15 +142,6 @@ struct _GsDetailsPage
        GtkWidget               *spinner_details;
        GtkWidget               *spinner_remove;
        GtkWidget               *stack_details;
-       GtkWidget               *grid_details_kudo;
-       GtkWidget               *image_details_kudo_docs;
-       GtkWidget               *image_details_kudo_integration;
-       GtkWidget               *image_details_kudo_translated;
-       GtkWidget               *image_details_kudo_updated;
-       GtkWidget               *label_details_kudo_docs;
-       GtkWidget               *label_details_kudo_integration;
-       GtkWidget               *label_details_kudo_translated;
-       GtkWidget               *label_details_kudo_updated;
        GtkWidget               *progressbar_top;
        guint                    progress_pulse_id;
        GtkWidget               *star_eventbox;
@@ -583,18 +574,6 @@ gs_details_page_set_description (GsDetailsPage *self, const gchar *tmp)
        gtk_widget_set_visible (self->label_webapp_warning, gs_app_get_kind (self->app) == 
AS_COMPONENT_KIND_WEB_APP);
 }
 
-static void
-gs_details_page_set_sensitive (GtkWidget *widget, gboolean is_active)
-{
-       GtkStyleContext *style_context;
-       style_context = gtk_widget_get_style_context (widget);
-       if (!is_active) {
-               gtk_style_context_add_class (style_context, "dim-label");
-       } else {
-               gtk_style_context_remove_class (style_context, "dim-label");
-       }
-}
-
 static gboolean
 gs_details_page_history_cb (GtkLabel *label,
                             gchar *uri,
@@ -1039,10 +1018,7 @@ gs_details_page_refresh_all (GsDetailsPage *self)
        g_autoptr(GIcon) icon = NULL;
        GList *addons;
        const gchar *tmp;
-       gboolean ret;
-       guint64 kudos;
        guint64 updated;
-       guint64 user_integration_bf;
        g_autofree gchar *origin = NULL;
        g_autoptr(GPtrArray) version_history = NULL;
        guint icon_size;
@@ -1200,40 +1176,6 @@ gs_details_page_refresh_all (GsDetailsPage *self)
                gtk_label_set_label (GTK_LABEL (self->label_details_origin_value), origin);
        }
 
-       /* set MyLanguage kudo */
-       kudos = gs_app_get_kudos (self->app);
-       ret = (kudos & GS_APP_KUDO_MY_LANGUAGE) > 0;
-       gtk_widget_set_sensitive (self->image_details_kudo_translated, ret);
-       gs_details_page_set_sensitive (self->label_details_kudo_translated, ret);
-
-       /* set RecentRelease kudo */
-       ret = (kudos & GS_APP_KUDO_RECENT_RELEASE) > 0;
-       gtk_widget_set_sensitive (self->image_details_kudo_updated, ret);
-       gs_details_page_set_sensitive (self->label_details_kudo_updated, ret);
-
-       /* set UserDocs kudo */
-       ret = (kudos & GS_APP_KUDO_INSTALLS_USER_DOCS) > 0;
-       gtk_widget_set_sensitive (self->image_details_kudo_docs, ret);
-       gs_details_page_set_sensitive (self->label_details_kudo_docs, ret);
-
-       /* any of the various integration kudos */
-       user_integration_bf = GS_APP_KUDO_SEARCH_PROVIDER |
-                             GS_APP_KUDO_USES_NOTIFICATIONS |
-                             GS_APP_KUDO_HIGH_CONTRAST;
-       ret = (kudos & user_integration_bf) > 0;
-       gtk_widget_set_sensitive (self->image_details_kudo_integration, ret);
-       gs_details_page_set_sensitive (self->label_details_kudo_integration, ret);
-
-       /* hide the kudo details for non-desktop software */
-       switch (gs_app_get_kind (self->app)) {
-       case AS_COMPONENT_KIND_DESKTOP_APP:
-               gtk_widget_set_visible (self->grid_details_kudo, TRUE);
-               break;
-       default:
-               gtk_widget_set_visible (self->grid_details_kudo, FALSE);
-               break;
-       }
-
        /* are we trying to replace something in the baseos */
        gtk_widget_set_visible (self->infobar_details_package_baseos,
                                gs_app_has_quirk (self->app, GS_APP_QUIRK_COMPULSORY) &&
@@ -2477,15 +2419,6 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, spinner_details);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, spinner_remove);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, stack_details);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, grid_details_kudo);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_docs);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_integration);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_translated);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, image_details_kudo_updated);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_docs);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_integration);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_translated);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_details_kudo_updated);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, progressbar_top);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, star_eventbox);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, origin_popover);
diff --git a/src/gs-details-page.ui b/src/gs-details-page.ui
index 1b78c4671..c5fe8d78d 100644
--- a/src/gs-details-page.ui
+++ b/src/gs-details-page.ui
@@ -796,117 +796,6 @@
                             <property name="visible">True</property>
                             <property name="margin_bottom">26</property>
                             <property name="spacing">30</property>
-                            <child>
-                              <object class="GtkGrid" id="grid_details_kudo">
-                                <property name="visible">True</property>
-                                <property name="row_spacing">9</property>
-                                <property name="column_spacing">12</property>
-                                <property name="hexpand">True</property>
-                                <child>
-                                  <object class="GtkImage" id="image_details_kudo_translated">
-                                    <property name="visible">True</property>
-                                    <property name="pixel_size">16</property>
-                                    <property name="icon_name">preferences-desktop-locale-symbolic</property>
-                                    <property name="icon_size">6</property>
-                                    <style>
-                                      <class name="kudo-pill"/>
-                                    </style>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">0</property>
-                                    <property name="top_attach">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkImage" id="image_details_kudo_docs">
-                                    <property name="visible">True</property>
-                                    <property name="pixel_size">16</property>
-                                    <property name="icon_name">system-help-symbolic</property>
-                                    <style>
-                                      <class name="kudo-pill"/>
-                                    </style>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">0</property>
-                                    <property name="top_attach">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkImage" id="image_details_kudo_updated">
-                                    <property name="visible">True</property>
-                                    <property name="pixel_size">16</property>
-                                    <property name="icon_name">software-update-available-symbolic</property>
-                                    <property name="icon_size">6</property>
-                                    <style>
-                                      <class name="kudo-pill"/>
-                                    </style>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">0</property>
-                                    <property name="top_attach">2</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkImage" id="image_details_kudo_integration">
-                                    <property name="visible">True</property>
-                                    <property name="pixel_size">16</property>
-                                    <property name="icon_name">emblem-system-symbolic</property>
-                                    <property name="icon_size">0</property>
-                                    <style>
-                                      <class name="kudo-pill"/>
-                                    </style>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">0</property>
-                                    <property name="top_attach">3</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label_details_kudo_translated">
-                                    <property name="visible">True</property>
-                                    <property name="label" translatable="yes">Localized in your 
Language</property>
-                                    <property name="xalign">0</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="top_attach">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label_details_kudo_docs">
-                                    <property name="visible">True</property>
-                                    <property name="label" translatable="yes">Documentation</property>
-                                    <property name="xalign">0</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="top_attach">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label_details_kudo_updated">
-                                    <property name="visible">True</property>
-                                    <property name="label" translatable="yes">Release Activity</property>
-                                    <property name="xalign">0</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="top_attach">2</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label_details_kudo_integration">
-                                    <property name="visible">True</property>
-                                    <property name="label" translatable="yes">System Integration</property>
-                                    <property name="xalign">0</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="top_attach">3</property>
-                                  </packing>
-                                </child>
-                              </object>
-                            </child>
                             <child>
                               <object class="GtkGrid" id="grid_details_details">
                                 <property name="visible">True</property>


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