[Xfce4-commits] [xfce/exo] 01/01: GTK3: Add insensitive state support for exo_cell_renderer_icon
noreply at xfce.org
noreply at xfce.org
Tue Jul 4 14:39:13 CEST 2017
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/exo.
commit 0f22ff6df412f63520f1dc5b2345c2be2800bd19
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Tue Jul 4 08:39:06 2017 -0400
GTK3: Add insensitive state support for exo_cell_renderer_icon
---
exo/exo-cell-renderer-icon.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/exo/exo-cell-renderer-icon.c b/exo/exo-cell-renderer-icon.c
index 6ffda7e..c210a14 100644
--- a/exo/exo-cell-renderer-icon.c
+++ b/exo/exo-cell-renderer-icon.c
@@ -576,7 +576,23 @@ exo_cell_renderer_icon_render (GtkCellRenderer *renderer,
}
#if GTK_CHECK_VERSION (3, 0, 0)
- /* FIXME */
+ /* check if we should render an insensitive icon */
+ if (G_UNLIKELY (gtk_widget_get_state_flags(widget) & GTK_STATE_INSENSITIVE || !gtk_cell_renderer_get_sensitive (renderer)))
+ {
+ style_context = gtk_widget_get_style_context (widget);
+ gtk_style_context_get (style_context, GTK_STATE_FLAG_INSENSITIVE,
+ GTK_STYLE_PROPERTY_COLOR,
+ &color_rgba, NULL);
+
+ color_gdk.pixel = 0;
+ color_gdk.red = color_rgba.red * 65535.0;
+ color_gdk.blue = color_rgba.blue * 65535.0;
+ color_gdk.green = color_rgba.green * 65535.0;
+ temp = exo_gdk_pixbuf_colorize (icon, &color_gdk);
+
+ g_object_unref (G_OBJECT (icon));
+ icon = temp;
+ }
#else
/* check if we should render an insensitive icon */
if (G_UNLIKELY (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE || !gtk_cell_renderer_get_sensitive (renderer)))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list