diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 9 | ||||
-rw-r--r-- | gtk/gtktreeview.c | 46 |
8 files changed, 109 insertions, 0 deletions
@@ -1,3 +1,12 @@ +Mon Feb 11 21:42:17 2002 Kristian Rietveld <kris@gtk.org> + + Implements DnD scrolling and fixes #71139 + + * gtk/gtktreeview.c (gtk_tree_view_vertical_autoscroll): new function, + (scroll_row_timeout): new function, + (gtk_tree_view_drag_motion): create scroll_timeout, so + scroll_row_timeout gets called + Mon Feb 11 17:54:46 2002 Kristian Rietveld <kris@gtk.org> * gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index ece3d3723..73690f53e 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,12 @@ +Mon Feb 11 21:42:17 2002 Kristian Rietveld <kris@gtk.org> + + Implements DnD scrolling and fixes #71139 + + * gtk/gtktreeview.c (gtk_tree_view_vertical_autoscroll): new function, + (scroll_row_timeout): new function, + (gtk_tree_view_drag_motion): create scroll_timeout, so + scroll_row_timeout gets called + Mon Feb 11 17:54:46 2002 Kristian Rietveld <kris@gtk.org> * gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ece3d3723..73690f53e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Mon Feb 11 21:42:17 2002 Kristian Rietveld <kris@gtk.org> + + Implements DnD scrolling and fixes #71139 + + * gtk/gtktreeview.c (gtk_tree_view_vertical_autoscroll): new function, + (scroll_row_timeout): new function, + (gtk_tree_view_drag_motion): create scroll_timeout, so + scroll_row_timeout gets called + Mon Feb 11 17:54:46 2002 Kristian Rietveld <kris@gtk.org> * gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index ece3d3723..73690f53e 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Mon Feb 11 21:42:17 2002 Kristian Rietveld <kris@gtk.org> + + Implements DnD scrolling and fixes #71139 + + * gtk/gtktreeview.c (gtk_tree_view_vertical_autoscroll): new function, + (scroll_row_timeout): new function, + (gtk_tree_view_drag_motion): create scroll_timeout, so + scroll_row_timeout gets called + Mon Feb 11 17:54:46 2002 Kristian Rietveld <kris@gtk.org> * gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index ece3d3723..73690f53e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Mon Feb 11 21:42:17 2002 Kristian Rietveld <kris@gtk.org> + + Implements DnD scrolling and fixes #71139 + + * gtk/gtktreeview.c (gtk_tree_view_vertical_autoscroll): new function, + (scroll_row_timeout): new function, + (gtk_tree_view_drag_motion): create scroll_timeout, so + scroll_row_timeout gets called + Mon Feb 11 17:54:46 2002 Kristian Rietveld <kris@gtk.org> * gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ece3d3723..73690f53e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Mon Feb 11 21:42:17 2002 Kristian Rietveld <kris@gtk.org> + + Implements DnD scrolling and fixes #71139 + + * gtk/gtktreeview.c (gtk_tree_view_vertical_autoscroll): new function, + (scroll_row_timeout): new function, + (gtk_tree_view_drag_motion): create scroll_timeout, so + scroll_row_timeout gets called + Mon Feb 11 17:54:46 2002 Kristian Rietveld <kris@gtk.org> * gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ece3d3723..73690f53e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Mon Feb 11 21:42:17 2002 Kristian Rietveld <kris@gtk.org> + + Implements DnD scrolling and fixes #71139 + + * gtk/gtktreeview.c (gtk_tree_view_vertical_autoscroll): new function, + (scroll_row_timeout): new function, + (gtk_tree_view_drag_motion): create scroll_timeout, so + scroll_row_timeout gets called + Mon Feb 11 17:54:46 2002 Kristian Rietveld <kris@gtk.org> * gtk/gtktreeview.c (gtk_tree_view_size_allocate): set upper diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index fcacd4eb1..cba2feb9f 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -2431,6 +2431,33 @@ gtk_tree_view_update_current_reorder (GtkTreeView *tree_view) gtk_tree_view_motion_draw_column_motion_arrow (tree_view); } +static void +gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) +{ + GdkRectangle visible_rect; + gint y; + gint offset; + gfloat value; + + gdk_window_get_pointer (tree_view->priv->bin_window, NULL, &y, NULL); + y += tree_view->priv->dy; + + gtk_tree_view_get_visible_rect (tree_view, &visible_rect); + + /* see if we are near the edge. */ + offset = y - (visible_rect.y + 2 * SCROLL_EDGE_SIZE); + if (offset > 0) + { + offset = y - (visible_rect.y + visible_rect.height - 2 * SCROLL_EDGE_SIZE); + if (offset < 0) + return; + } + + value = CLAMP (tree_view->priv->vadjustment->value + offset, 0.0, + tree_view->priv->vadjustment->upper - tree_view->priv->vadjustment->page_size); + gtk_adjustment_set_value (tree_view->priv->vadjustment, value); +} + static gboolean gtk_tree_view_horizontal_autoscroll (GtkTreeView *tree_view) { @@ -3774,6 +3801,20 @@ open_row_timeout (gpointer data) return result; } +static gint +scroll_row_timeout (gpointer data) +{ + GtkTreeView *tree_view = data; + + GDK_THREADS_ENTER (); + + gtk_tree_view_vertical_autoscroll (tree_view); + + GDK_THREADS_LEAVE (); + + return TRUE; +} + /* Returns TRUE if event should not be propagated to parent widgets */ static gboolean set_destination_row (GtkTreeView *tree_view, @@ -4162,6 +4203,11 @@ gtk_tree_view_drag_motion (GtkWidget *widget, tree_view->priv->open_dest_timeout = gtk_timeout_add (500, open_row_timeout, tree_view); } + else if (tree_view->priv->scroll_timeout == 0) + { + tree_view->priv->scroll_timeout = + gtk_timeout_add (150, scroll_row_timeout, tree_view); + } if (target == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE)) { |