From 529a3e672505ef112a74ef018e950a17b48ed271 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Mon, 4 Jun 2012 21:12:44 +0000 Subject: Fix redraw of embedded toolbar, by removing declaration of already declared local variable. Load toolbar resource trees at toolbar_init(). svn path=/trunk/netsurf/; revision=13956 --- atari/toolbar.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/atari/toolbar.c b/atari/toolbar.c index 7867dd5f5..62c09903c 100755 --- a/atari/toolbar.c +++ b/atari/toolbar.c @@ -172,6 +172,14 @@ void toolbar_init( void ) throbber_image = load_icon( "toolbar/default/throbber.png", toolbar_icon_callback, NULL ); + } else { + RsrcGaddr( h_gem_rsrc, R_TREE, TOOLBAR, &toolbar_buttons ); + toolbar_buttons->ob_x = 0; + toolbar_buttons->ob_y = 0; + + RsrcGaddr( h_gem_rsrc, R_TREE, THROBBER , &throbber_form ); + throbber_form->ob_x = 0; + throbber_form->ob_y = 0; } n = (sizeof( toolbar_styles ) / sizeof( struct s_toolbar_style )); for( i=0; irsc_id]; + tree = &toolbar_buttons[bt->rsc_id]; if( tree == NULL ) return; tree->ob_x = work.g_x; @@ -737,11 +745,7 @@ CMP_TOOLBAR tb_create( struct gui_window * gw ) t->comp->rect.g_h = toolbar_styles[t->style].height; t->comp->bounds.max_height = toolbar_styles[t->style].height; mt_CompEvntDataAdd(&app, t->comp, WM_REDRAW, evnt_toolbar_redraw, - NULL, EV_BOT); - - if( img_toolbar == false ){ - RsrcGaddr( h_gem_rsrc, R_TREE, TOOLBAR, &toolbar_buttons ); - } + gw, EV_BOT); /* count buttons and add them as components: */ i = 0; @@ -777,13 +781,8 @@ CMP_TOOLBAR tb_create( struct gui_window * gw ) mt_CompEvntAttach( &app, t->url.comp, WM_XBUTTON, evnt_url_click ); mt_CompDataAttach( &app, t->url.comp, CDT_OWNER, gw ); mt_CompAttach( &app, t->comp, t->url.comp ); - + /* create the throbber widget: */ - if( throbber_form == NULL && img_toolbar == false ) { - RsrcGaddr( h_gem_rsrc, R_TREE, THROBBER , &throbber_form ); - throbber_form->ob_x = 0; - throbber_form->ob_y = 0; - } t->throbber.comp = (COMPONENT*)mt_CompCreate(&app, CLT_HORIZONTAL, toolbar_styles[t->style].height, 0); t->throbber.comp->rect.g_h = toolbar_styles[t->style].height; -- cgit v1.2.3