[gnome-software/wip/hughsie/icon-dropshadow: 2/2] Don't apply drop shadow on stock symbolic icons, harder



commit 59c376c68bb1100fe6637f786f8bacf77297ba1e
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jul 16 10:16:01 2019 +0100

    Don't apply drop shadow on stock symbolic icons, harder
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-software/issues/693

 src/gs-summary-tile.c  | 7 +++++++
 src/gs-summary-tile.ui | 3 ---
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-summary-tile.c b/src/gs-summary-tile.c
index 6e120960..d568e218 100644
--- a/src/gs-summary-tile.c
+++ b/src/gs-summary-tile.c
@@ -97,6 +97,7 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsSummaryTile *tile)
 static void
 gs_summary_tile_set_app (GsAppTile *app_tile, GsApp *app)
 {
+       GtkStyleContext *context;
        const GdkPixbuf *pixbuf;
        GsSummaryTile *tile = GS_SUMMARY_TILE (app_tile);
        const gchar *css;
@@ -135,6 +136,12 @@ gs_summary_tile_set_app (GsAppTile *app_tile, GsApp *app)
        }
        gtk_label_set_label (GTK_LABEL (tile->name), gs_app_get_name (app));
 
+       context = gtk_widget_get_style_context (tile->image);
+       if (gs_app_get_use_drop_shadow (tile->app))
+               gtk_style_context_add_class (context, "icon-dropshadow");
+       else
+               gtk_style_context_remove_class (context, "icon-dropshadow");
+
        /* perhaps set custom css */
        css = gs_app_get_metadata_item (app, "GnomeSoftware::AppTile-css");
        gs_utils_widget_set_css (GTK_WIDGET (tile), css);
diff --git a/src/gs-summary-tile.ui b/src/gs-summary-tile.ui
index 0cb14cab..a63bbd6f 100644
--- a/src/gs-summary-tile.ui
+++ b/src/gs-summary-tile.ui
@@ -70,9 +70,6 @@
                     <property name="visible">True</property>
                     <property name="width-request">64</property>
                     <property name="height-request">64</property>
-                    <style>
-                      <class name="icon-dropshadow"/>
-                    </style>
                   </object>
                   <packing>
                     <property name="left-attach">0</property>


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