]> Pileus Git - ~andy/gtk/commitdiff
Don't rely on button allocations for invisible headers
authorMatthias Clasen <mclasen@redhat.com>
Fri, 10 Jun 2011 04:10:08 +0000 (00:10 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 10 Jun 2011 04:17:56 +0000 (00:17 -0400)
Now that we are not allocating treeview column buttons anymore
with invisible headers, we can't rely on their allocations for
other things like cell area computations anymore. Use x-offset
and width of the column directly, instead.

gtk/gtktreeview.c

index 60dee949c30a5f786009d3cc8d02d8684215282a..c5c3bd0a51ce7b49eb104b4fffadc8e90e22db99 100644 (file)
@@ -3180,8 +3180,6 @@ gtk_tree_view_button_press (GtkWidget      *widget,
          gtk_tree_view_column_get_resizable (column) &&
          _gtk_tree_view_column_get_window (column))
        {
-         GtkWidget *button;
-          GtkAllocation button_allocation;
          gpointer drag_data;
 
          if (event->type == GDK_2BUTTON_PRESS &&
@@ -3217,10 +3215,8 @@ gtk_tree_view_button_press (GtkWidget      *widget,
                                             0, 0, NULL, NULL,
                                             drag_data);
 
-         button = gtk_tree_view_column_get_button (column);
-          gtk_widget_get_allocation (button, &button_allocation);
          tree_view->priv->drag_pos = i;
-         tree_view->priv->x_drag = button_allocation.x + (rtl ? 0 : button_allocation.width);
+         tree_view->priv->x_drag = gtk_tree_view_column_get_x_offset (column) + (rtl ? 0 : gtk_tree_view_column_get_width (column));
 
          if (!gtk_widget_has_focus (widget))
            gtk_widget_grab_focus (widget);
@@ -13516,7 +13512,6 @@ gtk_tree_view_get_cell_area (GtkTreeView        *tree_view,
                              GtkTreeViewColumn  *column,
                              GdkRectangle       *rect)
 {
-  GtkAllocation allocation;
   GtkRBTree *tree = NULL;
   GtkRBNode *node = NULL;
   gint vertical_separator;
@@ -13540,9 +13535,8 @@ gtk_tree_view_get_cell_area (GtkTreeView        *tree_view,
 
   if (column)
     {
-      gtk_widget_get_allocation (gtk_tree_view_column_get_button (column), &allocation);
-      rect->x = allocation.x + horizontal_separator/2;
-      rect->width = allocation.width - horizontal_separator;
+      rect->x = gtk_tree_view_column_get_x_offset (column) + horizontal_separator/2;
+      rect->width = gtk_tree_view_column_get_width (column) - horizontal_separator;
     }
 
   if (path)