[gnome-builder] empty-state: set dim-label for -symbolic icon names



commit eb0e2d9da93cec76be366e4f4a34d95ab162dad9
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 18 13:39:35 2016 +0300

    empty-state: set dim-label for -symbolic icon names

 contrib/egg/egg-empty-state.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/contrib/egg/egg-empty-state.c b/contrib/egg/egg-empty-state.c
index ed76899..4bb83d8 100644
--- a/contrib/egg/egg-empty-state.c
+++ b/contrib/egg/egg-empty-state.c
@@ -280,7 +280,19 @@ egg_empty_state_set_icon_name (EggEmptyState *self,
 
   if (g_strcmp0 (icon_name, egg_empty_state_get_icon_name (self)) != 0)
     {
-      g_object_set (priv->image, "icon-name", icon_name, NULL);
+      GtkStyleContext *context;
+
+      g_object_set (priv->image,
+                    "icon-name", icon_name,
+                    NULL);
+
+      context = gtk_widget_get_style_context (GTK_WIDGET (priv->image));
+
+      if (icon_name != NULL && g_str_has_suffix (icon_name, "-symbolic"))
+        gtk_style_context_add_class (context, "dim-label");
+      else
+        gtk_style_context_remove_class (context, "dim-label");
+
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_ICON_NAME]);
     }
 }


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