summaryrefslogtreecommitdiff
path: root/gtk/gtkstyle.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2010-12-03 20:31:13 +0100
committerCarlos Garnacho <carlosg@gnome.org>2010-12-04 15:39:56 +0100
commitb75972d0cea9243f14ed15c98a2e89552cbe560a (patch)
treea559501123f2a123814b6ae0cae47b725b04e22d /gtk/gtkstyle.c
parentca59b042df53ba792cb33b430c317b68464fa592 (diff)
downloadgtk+-b75972d0cea9243f14ed15c98a2e89552cbe560a.tar.gz
GtkStyle: set style context state before calling gtk_render_icon_pixbuf()
Diffstat (limited to 'gtk/gtkstyle.c')
-rw-r--r--gtk/gtkstyle.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 83645560b5..ff7686a6ab 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -1693,6 +1693,7 @@ gtk_default_render_icon (GtkStyle *style,
{
GtkStyleContext *context;
GtkStylePrivate *priv;
+ GtkStateFlags flags = 0;
GdkPixbuf *pixbuf;
if (widget)
@@ -1711,6 +1712,20 @@ gtk_default_render_icon (GtkStyle *style,
if (detail)
transform_detail_string (detail, context);
+ switch (state)
+ {
+ case GTK_STATE_PRELIGHT:
+ flags |= GTK_STATE_FLAG_PRELIGHT;
+ break;
+ case GTK_STATE_INSENSITIVE:
+ flags |= GTK_STATE_FLAG_INSENSITIVE;
+ break;
+ default:
+ break;
+ }
+
+ gtk_style_context_set_state (context, flags);
+
pixbuf = gtk_render_icon_pixbuf (context, source, size);
gtk_style_context_restore (context);