]> Pileus Git - ~andy/gtk/commitdiff
Fixes #70708
authorKristian Rietveld <kris@gtk.org>
Wed, 6 Feb 2002 22:37:04 +0000 (22:37 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Wed, 6 Feb 2002 22:37:04 +0000 (22:37 +0000)
Wed Feb  6 23:28:39 2002  Kristian Rietveld  <kris@gtk.org>

        Fixes #70708

        * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): we're dealing
        with widget coordinates here, so take the header height into
        account while converting
        (gtk_tree_view_widget_to_tree_coords): take header height into
        account
        (gtk_tree_view_tree_to_widget_coords): ditto
        (gtk_tree_view_get_dest_row_at_pos): we were passing coords
        relative to the tree with _get_path_at_pos, while that function
        wants coords relative to the widget

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreeview.c

index 633111a19f576c3639f55bfe22e0261f0d04d4df..ba413242ead90eb790bdffdf1d716bc1dbf43f76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Wed Feb  6 23:28:39 2002  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes #70708
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): we're dealing
+       with widget coordinates here, so take the header height into
+       account while converting
+       (gtk_tree_view_widget_to_tree_coords): take header height into
+       account
+       (gtk_tree_view_tree_to_widget_coords): ditto
+       (gtk_tree_view_get_dest_row_at_pos): we were passing coords
+       relative to the tree with _get_path_at_pos, while that function
+       wants coords relative to the widget
+
 2002-02-06  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_scroll_hpages): remove unused variable
index 633111a19f576c3639f55bfe22e0261f0d04d4df..ba413242ead90eb790bdffdf1d716bc1dbf43f76 100644 (file)
@@ -1,3 +1,17 @@
+Wed Feb  6 23:28:39 2002  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes #70708
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): we're dealing
+       with widget coordinates here, so take the header height into
+       account while converting
+       (gtk_tree_view_widget_to_tree_coords): take header height into
+       account
+       (gtk_tree_view_tree_to_widget_coords): ditto
+       (gtk_tree_view_get_dest_row_at_pos): we were passing coords
+       relative to the tree with _get_path_at_pos, while that function
+       wants coords relative to the widget
+
 2002-02-06  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_scroll_hpages): remove unused variable
index 633111a19f576c3639f55bfe22e0261f0d04d4df..ba413242ead90eb790bdffdf1d716bc1dbf43f76 100644 (file)
@@ -1,3 +1,17 @@
+Wed Feb  6 23:28:39 2002  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes #70708
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): we're dealing
+       with widget coordinates here, so take the header height into
+       account while converting
+       (gtk_tree_view_widget_to_tree_coords): take header height into
+       account
+       (gtk_tree_view_tree_to_widget_coords): ditto
+       (gtk_tree_view_get_dest_row_at_pos): we were passing coords
+       relative to the tree with _get_path_at_pos, while that function
+       wants coords relative to the widget
+
 2002-02-06  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_scroll_hpages): remove unused variable
index 633111a19f576c3639f55bfe22e0261f0d04d4df..ba413242ead90eb790bdffdf1d716bc1dbf43f76 100644 (file)
@@ -1,3 +1,17 @@
+Wed Feb  6 23:28:39 2002  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes #70708
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): we're dealing
+       with widget coordinates here, so take the header height into
+       account while converting
+       (gtk_tree_view_widget_to_tree_coords): take header height into
+       account
+       (gtk_tree_view_tree_to_widget_coords): ditto
+       (gtk_tree_view_get_dest_row_at_pos): we were passing coords
+       relative to the tree with _get_path_at_pos, while that function
+       wants coords relative to the widget
+
 2002-02-06  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_scroll_hpages): remove unused variable
index 633111a19f576c3639f55bfe22e0261f0d04d4df..ba413242ead90eb790bdffdf1d716bc1dbf43f76 100644 (file)
@@ -1,3 +1,17 @@
+Wed Feb  6 23:28:39 2002  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes #70708
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): we're dealing
+       with widget coordinates here, so take the header height into
+       account while converting
+       (gtk_tree_view_widget_to_tree_coords): take header height into
+       account
+       (gtk_tree_view_tree_to_widget_coords): ditto
+       (gtk_tree_view_get_dest_row_at_pos): we were passing coords
+       relative to the tree with _get_path_at_pos, while that function
+       wants coords relative to the widget
+
 2002-02-06  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_scroll_hpages): remove unused variable
index 633111a19f576c3639f55bfe22e0261f0d04d4df..ba413242ead90eb790bdffdf1d716bc1dbf43f76 100644 (file)
@@ -1,3 +1,17 @@
+Wed Feb  6 23:28:39 2002  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes #70708
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): we're dealing
+       with widget coordinates here, so take the header height into
+       account while converting
+       (gtk_tree_view_widget_to_tree_coords): take header height into
+       account
+       (gtk_tree_view_tree_to_widget_coords): ditto
+       (gtk_tree_view_get_dest_row_at_pos): we were passing coords
+       relative to the tree with _get_path_at_pos, while that function
+       wants coords relative to the widget
+
 2002-02-06  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_scroll_hpages): remove unused variable
index 633111a19f576c3639f55bfe22e0261f0d04d4df..ba413242ead90eb790bdffdf1d716bc1dbf43f76 100644 (file)
@@ -1,3 +1,17 @@
+Wed Feb  6 23:28:39 2002  Kristian Rietveld  <kris@gtk.org>
+
+       Fixes #70708
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): we're dealing
+       with widget coordinates here, so take the header height into
+       account while converting
+       (gtk_tree_view_widget_to_tree_coords): take header height into
+       account
+       (gtk_tree_view_tree_to_widget_coords): ditto
+       (gtk_tree_view_get_dest_row_at_pos): we were passing coords
+       relative to the tree with _get_path_at_pos, while that function
+       wants coords relative to the widget
+
 2002-02-06  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextview.c (gtk_text_view_scroll_hpages): remove unused variable
index 4e0763ac5465688e38800faf1bedfc3acd2ffb10..70f62029a5f3cb1288405d78266abef92dccf4e5 100644 (file)
@@ -8487,7 +8487,7 @@ gtk_tree_view_get_path_at_pos (GtkTreeView        *tree_view,
     }
 
   y_offset = _gtk_rbtree_find_offset (tree_view->priv->tree,
-                                     TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y),
+                                     TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y - TREE_VIEW_HEADER_HEIGHT (tree_view)),
                                      &tree, &node);
 
   if (tree == NULL)
@@ -8688,7 +8688,7 @@ gtk_tree_view_widget_to_tree_coords (GtkTreeView *tree_view,
   if (tx)
     *tx = wx + tree_view->priv->hadjustment->value;
   if (ty)
-    *ty = wy + tree_view->priv->vadjustment->value;
+    *ty = wy + tree_view->priv->dy - TREE_VIEW_HEADER_HEIGHT (tree_view);
 }
 
 /**
@@ -8715,7 +8715,7 @@ gtk_tree_view_tree_to_widget_coords (GtkTreeView *tree_view,
   if (wx)
     *wx = tx - tree_view->priv->hadjustment->value;
   if (wy)
-    *wy = ty - tree_view->priv->vadjustment->value;
+    *wy = ty - tree_view->priv->dy + TREE_VIEW_HEADER_HEIGHT (tree_view);
 }
 
 static void
@@ -8894,7 +8894,6 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView             *tree_view,
   gint cell_y;
   gdouble offset_into_row;
   gdouble quarter;
-  gint x, y;
   GdkRectangle cell;
   GtkTreeViewColumn *column = NULL;
   GtkTreePath *tmp_path = NULL;
@@ -8915,18 +8914,13 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView             *tree_view,
   if (tree_view->priv->tree == NULL)
     return FALSE;
 
-  /* remember that drag_x and drag_y are in widget coords, convert to tree window */
-
-  gtk_tree_view_widget_to_tree_coords (tree_view, drag_x, drag_y,
-                                       &x, &y);
-
   /* If in the top quarter of a row, we drop before that row; if
    * in the bottom quarter, drop after that row; if in the middle,
    * and the row has children, drop into the row.
    */
 
   if (!gtk_tree_view_get_path_at_pos (tree_view,
-                                      x, y,
+                                      drag_x, drag_y,
                                       &tmp_path,
                                       &column,
                                       NULL,