Author: mono
Date: Wed Jan 11 14:35:50 2012
New Revision: 13400
URL:
http://source.netsurf-browser.org?rev=13400&view=rev
Log:
Added functions to hide/show the toolbar.
Modified:
trunk/netsurf/atari/toolbar.c
trunk/netsurf/atari/toolbar.h
Modified: trunk/netsurf/atari/toolbar.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/atari/toolbar.c?rev=13400...
==============================================================================
--- trunk/netsurf/atari/toolbar.c (original)
+++ trunk/netsurf/atari/toolbar.c Wed Jan 11 14:35:50 2012
@@ -409,7 +409,7 @@
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_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 );
+}
+
Modified: trunk/netsurf/atari/toolbar.h
URL:
http://source.netsurf-browser.org/trunk/netsurf/atari/toolbar.h?rev=13400...
==============================================================================
--- trunk/netsurf/atari/toolbar.h (original)
+++ trunk/netsurf/atari/toolbar.h Wed Jan 11 14:35:50 2012
@@ -70,7 +70,8 @@
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 @@
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