summaryrefslogtreecommitdiff
path: root/gtk/gtkcellrenderer.c
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2011-12-16 19:45:53 +0000
committerRui Matos <tiagomatos@gmail.com>2011-12-19 19:21:15 +0000
commit42d2a1984ca6ec2d1bf613e93a904ace4d384486 (patch)
tree2bad82c3e11359c9c57aa63127e2f712902768ba /gtk/gtkcellrenderer.c
parent8baf65b5956738bdfbc3df4bbbdb83c3d92f1c52 (diff)
downloadgtk+-42d2a1984ca6ec2d1bf613e93a904ace4d384486.tar.gz
cellrenderer: Use the widget state flags as a base for cell renderers' state
Diffstat (limited to 'gtk/gtkcellrenderer.c')
-rw-r--r--gtk/gtkcellrenderer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c
index 609c4a2923..1cef97bffa 100644
--- a/gtk/gtkcellrenderer.c
+++ b/gtk/gtkcellrenderer.c
@@ -1742,7 +1742,12 @@ gtk_cell_renderer_get_state (GtkCellRenderer *cell,
g_return_val_if_fail (!cell || GTK_IS_CELL_RENDERER (cell), 0);
g_return_val_if_fail (!widget || GTK_IS_WIDGET (widget), 0);
- if ((widget && !gtk_widget_is_sensitive (widget)) ||
+ if (widget)
+ state |= gtk_widget_get_state_flags (widget);
+
+ state &= ~(GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED);
+
+ if ((state & GTK_STATE_FLAG_INSENSITIVE) != 0 ||
(cell && !gtk_cell_renderer_get_sensitive (cell)) ||
(cell_state & GTK_CELL_RENDERER_INSENSITIVE) != 0)
{