[gtk+] treeview: Use the widget state flags as a base for drawing expanders



commit 440663f3fed5aa92997204889b5b9eb6e8c7cd3c
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Dec 22 02:59:16 2011 +0000

    treeview: Use the widget state flags as a base for drawing expanders

 gtk/gtktreeview.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 25d2f8f..eb3afc8 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -10052,7 +10052,7 @@ gtk_tree_view_draw_arrow (GtkTreeView *tree_view,
   gint x2;
   gint vertical_separator;
   gint expander_size;
-  GtkCellRendererState flags;
+  GtkCellRendererState flags = 0;
 
   widget = GTK_WIDGET (tree_view);
   context = gtk_widget_get_style_context (widget);
@@ -10074,24 +10074,19 @@ gtk_tree_view_draw_arrow (GtkTreeView *tree_view,
   area.height = gtk_tree_view_get_cell_area_height (tree_view, node,
                                                     vertical_separator);
 
-  if (!gtk_widget_get_sensitive (widget))
-    state |= GTK_STATE_FLAG_INSENSITIVE;
-  else
-    {
-      flags = 0;
+  if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
+    flags |= GTK_CELL_RENDERER_SELECTED;
 
-      if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
-        flags |= GTK_CELL_RENDERER_SELECTED;
+  if (node == tree_view->priv->prelight_node &&
+      tree_view->priv->arrow_prelit)
+    flags |= GTK_CELL_RENDERER_PRELIT;
 
-      state = gtk_cell_renderer_get_state (NULL, widget, flags);
-
-      if (node == tree_view->priv->prelight_node &&
-          tree_view->priv->arrow_prelit)
-	state |= GTK_STATE_FLAG_PRELIGHT;
-    }
+  state = gtk_cell_renderer_get_state (NULL, widget, flags);
 
   if (node->children != NULL)
     state |= GTK_STATE_FLAG_ACTIVE;
+  else
+    state &= ~(GTK_STATE_FLAG_ACTIVE);
 
   gtk_style_context_save (context);
 



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