summaryrefslogtreecommitdiff
path: root/gtk/gtkcellrendererpixbuf.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2013-09-05 18:45:13 +0200
committerBenjamin Otte <otte@redhat.com>2013-09-05 18:48:47 +0200
commitfa3b803de9aef33208a71c6e2113deac468e5f8d (patch)
treef6e3fbf047f8295cb6b03b7613015e187b4d8d67 /gtk/gtkcellrendererpixbuf.c
parent502d7644fea442c4ad1bbeff08ffb6d858e13e3b (diff)
downloadgtk+-fa3b803de9aef33208a71c6e2113deac468e5f8d.tar.gz
cellrendererpixbuf: Don't eat states
Even when not following states, blacklist the states we don't follow instead of whitelisting the ones we do. This way, we don't accidentally eat new ones like the text direction flags. Fixes a bug where text direction wasn't available when rendering stock items. https://bugzilla.gnome.org/show_bug.cgi?id=702423
Diffstat (limited to 'gtk/gtkcellrendererpixbuf.c')
-rw-r--r--gtk/gtkcellrendererpixbuf.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c
index 1ae79950e1..1af8c423ea 100644
--- a/gtk/gtkcellrendererpixbuf.c
+++ b/gtk/gtkcellrendererpixbuf.c
@@ -531,13 +531,10 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
context = gtk_widget_get_style_context (widget);
gtk_style_context_save (context);
- state = GTK_STATE_FLAG_NORMAL;
+ state = gtk_cell_renderer_get_state (cell, widget, flags);
- if (priv->follow_state)
- state = gtk_cell_renderer_get_state (cell, widget, flags);
- else if (!gtk_widget_get_sensitive (widget) ||
- !gtk_cell_renderer_get_sensitive (cell))
- state |= GTK_STATE_FLAG_INSENSITIVE;
+ if (!priv->follow_state)
+ state &= ~(GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED);
gtk_style_context_set_state (context, state);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_IMAGE);