[gtk+/treeview-refactor] Handle clicks in indentation area



commit d743ecf82e8ca7198d3b6d8a569764e8ee003238
Author: Kristian Rietveld <kris gtk org>
Date:   Sun Dec 12 17:32:59 2010 +0100

    Handle clicks in indentation area
    
    For this case, we want to set focus on the first cell in the column.

 gtk/gtktreeviewcolumn.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index fd5eb1c..2621cb3 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -1479,6 +1479,14 @@ _gtk_tree_view_column_get_cell_at_pos (GtkTreeViewColumn *column,
   GtkCellRenderer *match = NULL;
   GtkTreeViewColumnPrivate *priv = column->priv;
 
+  if (x < cell_area->x)
+    {
+      /* This can happen when we click in the "indentation".  In this
+       * case, we set x to cell_area->x, the start of the first cell.
+       */
+      x = cell_area->x;
+    }
+
   match = gtk_cell_area_get_cell_at_position (priv->cell_area,
                                               priv->cell_area_context,
                                               priv->tree_view,



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