[gnome-builder/gnome-builder-3-20] empty-state: set dim-label for -symbolic icon names
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-20] empty-state: set dim-label for -symbolic icon names
- Date: Wed, 18 May 2016 11:13:41 +0000 (UTC)
commit 71f99796dc15f4a9459ec966009f8b515f180207
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]