summaryrefslogtreecommitdiff
path: root/amiga/tree.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-10-19 22:22:03 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-10-19 22:22:03 +0000
commit5d40458ad550d3a35694167b26f130deae3188e6 (patch)
treef285673a9f0f74e07e47f305cdd83fd0f39a11a4 /amiga/tree.c
parentdd067c9fba4d783f5515b7df19aae418903257a4 (diff)
downloadnetsurf-5d40458ad550d3a35694167b26f130deae3188e6.tar.gz
netsurf-5d40458ad550d3a35694167b26f130deae3188e6.tar.bz2
Auto-scroll on drags beyond window boundaries
svn path=/trunk/netsurf/; revision=10894
Diffstat (limited to 'amiga/tree.c')
-rwxr-xr-xamiga/tree.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/amiga/tree.c b/amiga/tree.c
index 07ad893fd..0119c0f7e 100755
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -242,8 +242,6 @@ void ami_tree_scroll(struct treeview_window *twin, int sx, int sy)
int x, y;
if(!twin) return;
- if(sx<0) sx=0;
- if(sy<0) sy=0;
GetAttr(SCROLLER_Top, twin->objects[OID_HSCROLL], (ULONG *)&x);
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&y);
@@ -678,6 +676,27 @@ BOOL ami_tree_event(struct treeview_window *twin)
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&ys);
y = twin->win->MouseY - bbox->Top + ys;
+ if(twin->mouse_state & BROWSER_MOUSE_DRAG_ON)
+ {
+ int drag_x_move = 0, drag_y_move = 0;
+
+ /* TODO: Show drag icons on TREE_MOVE_DRAG start.
+ * Until then, the below line does nothing. */
+ ami_drag_icon_move();
+
+ if(twin->win->MouseX < bbox->Left)
+ drag_x_move = twin->win->MouseX - bbox->Left;
+ if(twin->win->MouseX > (bbox->Left + bbox->Width))
+ drag_x_move = twin->win->MouseX - (bbox->Left + bbox->Width);
+ if(twin->win->MouseY < bbox->Top)
+ drag_y_move = twin->win->MouseY - bbox->Top;
+ if(twin->win->MouseY > (bbox->Top + bbox->Height))
+ drag_y_move = twin->win->MouseY - (bbox->Top + bbox->Height);
+
+ if(drag_x_move || drag_y_move)
+ ami_tree_scroll(twin, drag_x_move, drag_y_move);
+ }
+
if((x >= xs) && (y >= ys) && (x < bbox->Width + xs) &&
(y < bbox->Height + ys))
{