summaryrefslogtreecommitdiff
path: root/atari/toolbar.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2011-12-04 13:02:07 +0000
committerOle Loots <ole@monochrom.net>2011-12-04 13:02:07 +0000
commitc3be583d22270d91fe2466069c3c6e25de1b87c3 (patch)
treedf101c837598acfc895652506ba28086e6180256 /atari/toolbar.c
parent3de94225940a06d228cfd17c48f57edf8dab16b6 (diff)
downloadnetsurf-c3be583d22270d91fe2466069c3c6e25de1b87c3.tar.gz
netsurf-c3be583d22270d91fe2466069c3c6e25de1b87c3.tar.bz2
Added drag feature to the new url input.
svn path=/trunk/netsurf/; revision=13232
Diffstat (limited to 'atari/toolbar.c')
-rwxr-xr-xatari/toolbar.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/atari/toolbar.c b/atari/toolbar.c
index e08124dbd..8cddffe03 100755
--- a/atari/toolbar.c
+++ b/atari/toolbar.c
@@ -315,13 +315,32 @@ void __CDECL evnt_url_click( COMPONENT *c, long buff[8] )
window_set_focus( gw, URL_WIDGET, (void*)&tb->url );
} else {
if( mb & 1 ) {
- /* TODO: if the button is dragging, report drag event */
+ textarea_mouse_action( tb->url.textarea, BROWSER_MOUSE_DRAG_1,
+ mx, my );
+ short prev_x = mx;
+ short prev_y = my;
+ do{
+ if( abs(prev_x-mx) > 5 || abs(prev_y-my) > 5 ){
+ textarea_mouse_action( tb->url.textarea,
+ BROWSER_MOUSE_HOLDING_1, mx, my );
+ prev_x = mx;
+ prev_y = my;
+ if( tb->url.redraw ){
+ tb_url_redraw( gw );
+ }
+ }
+ graf_mkstate( &mx, &my, &mb, &kstat );
+ mx = mx - (work.g_x + TOOLBAR_URL_MARGIN_LEFT);
+ my = my - (work.g_y + TOOLBAR_URL_MARGIN_TOP);
+ }while( mb & 1 );
+ textarea_drag_end( tb->url.textarea, 0, mx, my );
} else {
/* TODO: recognize click + shift key */
int mstate = BROWSER_MOUSE_PRESS_1;
if( (kstat & (K_LSHIFT|K_RSHIFT)) != 0 )
mstate = BROWSER_MOUSE_MOD_1;
- textarea_mouse_action( tb->url.textarea, BROWSER_MOUSE_PRESS_1, mx, my );
+ textarea_mouse_action( tb->url.textarea,
+ BROWSER_MOUSE_PRESS_1, mx, my );
}
}
// TODO: do not send an complete redraw!