From 0b3977b52bc7c375b841764750c6913e2cf7f80a Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Wed, 23 Nov 2011 19:59:24 +0000 Subject: Removed resize widget from statusbar ( Not needed anymore, window has native widgets now) svn path=/trunk/netsurf/; revision=13166 --- atari/statusbar.c | 55 ++++++++++++++----------------------------------------- atari/statusbar.h | 4 ---- 2 files changed, 14 insertions(+), 45 deletions(-) (limited to 'atari') diff --git a/atari/statusbar.c b/atari/statusbar.c index 30cc3804c..24c55526a 100755 --- a/atari/statusbar.c +++ b/atari/statusbar.c @@ -74,14 +74,14 @@ void __CDECL evnt_sb_redraw( COMPONENT *c, long buff[8] ) vsl_type( vdih, 1); vsl_width( vdih, 1 ); vst_color(vdih, BLACK); - //vst_point( vdih, 9, &pxy[0], &pxy[1], &pxy[2], &pxy[3] ); - vst_height( vdih, atari_sysinfo.medium_sfont_pxh, &pxy[0], &pxy[1], &pxy[2], &pxy[3] ); + + vst_height( vdih, atari_sysinfo.medium_sfont_pxh, &pxy[0], &pxy[1], &pxy[2], &pxy[3] ); vst_alignment(vdih, 0, 5, &d, &d ); vst_effects( vdih, 0 ); pxyclip[0] = lclip.g_x; pxyclip[1] = lclip.g_y; - pxyclip[2] = lclip.g_x + lclip.g_w; - pxyclip[3] = lclip.g_y + lclip.g_h; + pxyclip[2] = lclip.g_x + lclip.g_w-1; + pxyclip[3] = lclip.g_y + lclip.g_h-1; vs_clip(vdih, 1, (short*)&pxyclip ); vswr_mode( vdih, MD_REPLACE ); @@ -102,7 +102,7 @@ void __CDECL evnt_sb_redraw( COMPONENT *c, long buff[8] ) pxy[0] = work.g_x; pxy[1] = work.g_y+1; - pxy[2] = work.g_x + work.g_w; + pxy[2] = work.g_x + work.g_w-1; pxy[3] = work.g_y + work.g_h-1; v_bar( vdih, pxy ); @@ -132,19 +132,12 @@ void __CDECL evnt_sb_redraw( COMPONENT *c, long buff[8] ) break; } } - vswr_mode( vdih, MD_REPLACE ); - - pxy[0] = work.g_x + work.g_w - MOVER_WH; - pxy[1] = work.g_y + 1; - pxy[2] = work.g_x + work.g_w; - pxy[3] = work.g_y + work.g_h-1; - v_bar( vdih, pxy ); - - pxy[0] = work.g_x + work.g_w - MOVER_WH; - 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 ); + vswr_mode( vdih, MD_REPLACE ); + pxy[0] = work.g_x + work.g_w; + pxy[1] = work.g_y + work.g_h; + pxy[2] = work.g_x + work.g_w; + pxy[3] = work.g_y + work.g_h-work.g_h; + v_pline( vdih, 2, (short*)&pxy ); vs_clip(vdih, 0, (short*)&pxyclip ); return; @@ -156,35 +149,15 @@ static void __CDECL evnt_sb_click( COMPONENT *c, long buff[8] ) 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 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] = 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 ); - } - } + if( evnt.mx >= work.g_x + (work.g_w) && evnt.mx <= work.g_x + work.g_w && + evnt.my >= work.g_y + (work.g_h) && evnt.my <= work.g_y + work.g_h ) { + // click within sb button } } 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; diff --git a/atari/statusbar.h b/atari/statusbar.h index 0794c6438..fd01a0c79 100755 --- a/atari/statusbar.h +++ b/atari/statusbar.h @@ -21,7 +21,6 @@ #define STATUSBAR_HEIGHT 16 #define STATUSBAR_MAX_SLEN 255 -#define MOVER_WH 16 struct s_statusbar { @@ -29,9 +28,6 @@ struct s_statusbar char text[STATUSBAR_MAX_SLEN+1]; size_t textlen; bool attached; - bool resize_init; - short resize_delta_x; - short resize_delta_y; }; -- cgit v1.2.3