diff options
author | Ole Loots <ole@monochrom.net> | 2012-01-11 20:35:50 +0000 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2012-01-11 20:35:50 +0000 |
commit | 3e9983abf2bdd282e1dfef9a2c83797a787cc6ea (patch) | |
tree | 378b4b22e6c1ece74f46e0cc5e37efa7291b1879 | |
parent | a5a0b8d955c237515a0b01b8e2df960284d12252 (diff) | |
download | netsurf-3e9983abf2bdd282e1dfef9a2c83797a787cc6ea.tar.gz netsurf-3e9983abf2bdd282e1dfef9a2c83797a787cc6ea.tar.bz2 |
Added functions to hide/show the toolbar.
svn path=/trunk/netsurf/; revision=13400
-rwxr-xr-x | atari/toolbar.c | 22 | ||||
-rwxr-xr-x | atari/toolbar.h | 7 |
2 files changed, 26 insertions, 3 deletions
diff --git a/atari/toolbar.c b/atari/toolbar.c index 081ef43b1..57671ab99 100755 --- a/atari/toolbar.c +++ b/atari/toolbar.c @@ -409,7 +409,7 @@ static void tb_txt_request_redraw(void *data, int x, int y, int w, int h) t->url.rdw_area.g_h = ( oldy1 > newy1 ) ?
oldy1 - t->url.rdw_area.g_y : newy1 - t->url.rdw_area.g_y;
}
-}
+} void tb_url_redraw( struct gui_window * gw )
{
@@ -752,5 +752,25 @@ void tb_home_click( struct gui_window * gw ) void tb_stop_click( struct gui_window * gw )
{
browser_window_stop( gw->browser->bw );
+} + + +void tb_hide( struct gui_window * gw, short mode ) +{ + CMP_TOOLBAR tb = gw->root->toolbar; + assert( tb != NULL ); + if( mode == 1 ){ + tb->hidden = true; + tb->comp->rect.g_h = 0; + tb->comp->bounds.max_height = 0; + + } else { + tb->hidden = false; + tb->comp->rect.g_h = TOOLBAR_HEIGHT; + tb->comp->bounds.max_height = TOOLBAR_HEIGHT; + } + gw->browser->reformat_pending = true; + browser_update_rects( gw ); + snd_rdw( gw->root->handle ); }
diff --git a/atari/toolbar.h b/atari/toolbar.h index ba967f91e..27bf4396f 100755 --- a/atari/toolbar.h +++ b/atari/toolbar.h @@ -70,7 +70,8 @@ struct s_toolbar struct s_throbber_widget throbber; GRECT btdim;
/* size & location of buttons: */ - struct s_tb_button * buttons;
+ struct s_tb_button * buttons; + bool hidden;
int btcnt;
};
@@ -96,6 +97,8 @@ bool tb_url_input( struct gui_window * gw, short keycode ); void tb_url_set( struct gui_window * gw, char * text ); /* perform redraw of invalidated url textinput areas: */ void tb_url_redraw( struct gui_window * gw );
-struct gui_window * tb_gui_window( CMP_TOOLBAR tb );
+struct gui_window * tb_gui_window( CMP_TOOLBAR tb ); +/* hide toolbar, mode = 1: hide, mode = 0: show */ +void tb_hide( struct gui_window * gw, short mode );
#endif
|