[gtk+/wip/unfocused-fixes: 11/13] cellrenderer: Use the widget state flags as a base for cell renderers' state



commit c6143ff71aeb271fbc25b9366750738f6fd9a3f3
Author: Rui Matos <tiagomatos gmail com>
Date:   Fri Dec 16 19:45:53 2011 +0000

    cellrenderer: Use the widget state flags as a base for cell renderers' state

 gtk/gtkcellrenderer.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c
index 609c4a2..1cef97b 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)
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]