summaryrefslogtreecommitdiff
path: root/atari/statusbar.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2011-08-05 01:12:03 +0000
committerOle Loots <ole@monochrom.net>2011-08-05 01:12:03 +0000
commit68b52a602399c98e8071feffb51b65cc1e3b469d (patch)
tree090aa17120ac2fc1d6f48e986bd19d2ca9e13e3d /atari/statusbar.c
parent33aebf6fd1986c52cc40e49e8d42455a7ffbe769 (diff)
downloadnetsurf-68b52a602399c98e8071feffb51b65cc1e3b469d.tar.gz
netsurf-68b52a602399c98e8071feffb51b65cc1e3b469d.tar.bz2
Improved accuracy for window resize.
svn path=/trunk/netsurf/; revision=12636
Diffstat (limited to 'atari/statusbar.c')
-rwxr-xr-xatari/statusbar.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/atari/statusbar.c b/atari/statusbar.c
index 0e8114132..30cc3804c 100755
--- a/atari/statusbar.c
+++ b/atari/statusbar.c
@@ -130,7 +130,7 @@ void __CDECL evnt_sb_redraw( COMPONENT *c, long buff[8] )
curx += cw;
if( curx >= lclip.g_x + lclip.g_w )
break;
- }
+ }
}
vswr_mode( vdih, MD_REPLACE );
@@ -144,7 +144,7 @@ void __CDECL evnt_sb_redraw( COMPONENT *c, long buff[8] )
pxy[1] = work.g_y + work.g_h;
pxy[2] = work.g_x + work.g_w - MOVER_WH;
pxy[3] = work.g_y + work.g_h - MOVER_WH;
- v_pline( vdih, 2, (short*)&pxy );
+ v_pline( vdih, 2, (short*)&pxy );
vs_clip(vdih, 0, (short*)&pxyclip );
return;
@@ -152,23 +152,29 @@ void __CDECL evnt_sb_redraw( COMPONENT *c, long buff[8] )
static void __CDECL evnt_sb_click( COMPONENT *c, long buff[8] )
{
+ static bool prevstate;
short sbuff[8], mx, my;
LGRECT work;
mt_CompGetLGrect(&app, c, WF_WORKXYWH, &work);
if( evnt.mx >= work.g_x + (work.g_w - MOVER_WH) && evnt.mx <= work.g_x + work.g_w &&
evnt.my >= work.g_y + (work.g_h - MOVER_WH) && evnt.my <= work.g_y + work.g_h ) {
- /* click into the mover region */
+ /* click into the resizer region */
struct gui_window * g;
for( g = window_list; g; g=g->next ) {
if( g->root->statusbar->comp == c ) {
+ if( g->root->statusbar->resize_init == true ){
+ g->root->statusbar->resize_init = false;
+ g->root->statusbar->resize_delta_x = g->root->loc.g_x+g->root->loc.g_w - evnt.mx;
+ g->root->statusbar->resize_delta_y = g->root->loc.g_y+g->root->loc.g_h - evnt.my;
+ }
sbuff[0] = WM_SIZED;
sbuff[1] = (short)buff[0];
sbuff[2] = 0;
sbuff[3] = g->root->handle->handle;
sbuff[4] = g->root->loc.g_x;
sbuff[5] = g->root->loc.g_y;
- sbuff[6] = g->root->loc.g_w;
- sbuff[7] = g->root->loc.g_h;
+ sbuff[6] = evnt.mx - sbuff[4] + g->root->statusbar->resize_delta_x;
+ sbuff[7] = evnt.my - sbuff[5] + g->root->statusbar->resize_delta_y;
evnt_window_resize( g->root->handle, sbuff, g );
}
}
@@ -178,6 +184,7 @@ static void __CDECL evnt_sb_click( COMPONENT *c, long buff[8] )
CMP_STATUSBAR sb_create( struct gui_window * gw )
{
CMP_STATUSBAR s = malloc( sizeof(struct s_statusbar) );
+ s->resize_init = true;
s->attached = false;
s->comp = (COMPONENT*)mt_CompCreate(&app, CLT_HORIZONTAL, STATUSBAR_HEIGHT, 0);
s->comp->rect.g_h = STATUSBAR_HEIGHT;