summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2013-04-19 17:20:12 -0500
committerFederico Mena Quintero <federico@gnome.org>2013-04-19 17:24:03 -0500
commit2db8e25cdb2aab8de12e88b9532f322c2fb56416 (patch)
tree3f77c9b8a5ed3869debaa62b93e1ff88ee56f56b
parenta1b9bf7fbc9da6b162327c59ee2d347f1b16a033 (diff)
downloadgtk+-2db8e25cdb2aab8de12e88b9532f322c2fb56416.tar.gz
treeview: Use equal areas in the computation of drag dest row positions
We used to divide the row in thirds vertically, and use the outer thirds for GTK_TREE_VIEW_DROP_BEFORE and AFTER, respectively. Now we use *fourths*. This is so that we get equal areas for these: GTK_TREE_VIEW_DROP_BEFORE GTK_TREE_VIEW_DROP_INTO_OR_BEFORE GTK_TREE_VIEW_DROP_INTO_OR_AFTER GTK_TREE_VIEW_DROP_AFTER This makes hovering tree rows much more positive. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
-rw-r--r--gtk/gtktreeview.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index cb43c7f2d0..3de5599bec 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -14420,7 +14420,7 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view,
gint cell_y;
gint bin_x, bin_y;
gdouble offset_into_row;
- gdouble third;
+ gdouble fourth;
GdkRectangle cell;
GtkTreeViewColumn *column = NULL;
GtkTreePath *tmp_path = NULL;
@@ -14442,8 +14442,8 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view,
if (tree_view->priv->tree == NULL)
return FALSE;
- /* If in the top third of a row, we drop before that row; if
- * in the bottom third, drop after that row; if in the middle,
+ /* If in the top fourth of a row, we drop before that row; if
+ * in the bottom fourth, drop after that row; if in the middle,
* and the row has children, drop into the row.
*/
gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, drag_x, drag_y,
@@ -14470,11 +14470,11 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view,
tmp_path = NULL;
- third = cell.height / 3.0;
+ fourth = cell.height / 4.0;
if (pos)
{
- if (offset_into_row < third)
+ if (offset_into_row < fourth)
{
*pos = GTK_TREE_VIEW_DROP_BEFORE;
}
@@ -14482,7 +14482,7 @@ gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view,
{
*pos = GTK_TREE_VIEW_DROP_INTO_OR_BEFORE;
}
- else if (offset_into_row < third * 2.0)
+ else if (offset_into_row < cell.height - fourth)
{
*pos = GTK_TREE_VIEW_DROP_INTO_OR_AFTER;
}