summaryrefslogtreecommitdiff
path: root/atari/toolbar.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2012-11-28 21:30:24 +0100
committerOle Loots <ole@monochrom.net>2012-11-28 21:30:24 +0100
commitff7cf937629933e782eb8103dadb8b5f27f14a4d (patch)
treeb4067d388769f26d95e032437b1cb518de5ed09e /atari/toolbar.c
parentfe0e2508e62323955df415b45e2ea9b1b7d6373f (diff)
downloadnetsurf-ff7cf937629933e782eb8103dadb8b5f27f14a4d.tar.gz
netsurf-ff7cf937629933e782eb8103dadb8b5f27f14a4d.tar.bz2
Started refactoring of global redraw handling.
Diffstat (limited to 'atari/toolbar.c')
-rw-r--r--atari/toolbar.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/atari/toolbar.c b/atari/toolbar.c
index 39025697d..75d7abe28 100644
--- a/atari/toolbar.c
+++ b/atari/toolbar.c
@@ -116,7 +116,8 @@ struct s_toolbar
bool hidden;
int btcnt;
int style;
- bool redraw;
+ bool redraw;
+ bool reflow;
};
extern char * option_homepage_url;
@@ -410,6 +411,8 @@ void toolbar_destroy(struct s_toolbar *tb)
static void toolbar_objc_reflow(struct s_toolbar *tb)
{
+
+ // position toolbar areas:
aes_toolbar->ob_x = tb->area.g_x;
aes_toolbar->ob_y = tb->area.g_y;
aes_toolbar->ob_width = tb->area.g_w;
@@ -421,13 +424,6 @@ static void toolbar_objc_reflow(struct s_toolbar *tb)
aes_toolbar[TOOLBAR_URL_AREA].ob_width = tb->area.g_w
- (aes_toolbar[TOOLBAR_NAVIGATION_AREA].ob_width
+ aes_toolbar[TOOLBAR_THROBBER_AREA].ob_width);
-}
-
-void toolbar_redraw(struct s_toolbar *tb, GRECT *clip)
-{
- // position toolbar areas:
- toolbar_objc_reflow(tb);
- objc_draw_grect(aes_toolbar,0,8,clip);
// position throbber image:
throbber_form[tb->throbber.index].ob_x = tb->area.g_x +
@@ -442,10 +438,17 @@ void toolbar_redraw(struct s_toolbar *tb, GRECT *clip)
((aes_toolbar[TOOLBAR_THROBBER_AREA].ob_height
- throbber_form[tb->throbber.index].ob_height) >> 1);
- printf("x pos: %d, y pos: %d\n", throbber_form[tb->throbber.index].ob_x,
- throbber_form[tb->throbber.index].ob_y);
- objc_draw_grect(&throbber_form[tb->throbber.index], 0, 1, clip);
+ tb->reflow = false;
+}
+
+void toolbar_redraw(struct s_toolbar *tb, GRECT *clip)
+{
+ if(tb->reflow == true)
+ toolbar_objc_reflow(tb);
+ objc_draw_grect(aes_toolbar,0,8,clip);
+
+ objc_draw_grect(&throbber_form[tb->throbber.index], 0, 1, clip);
}
@@ -459,9 +462,7 @@ void toolbar_update_buttons(struct s_toolbar *tb, struct browser_window *bw,
void toolbar_set_dimensions(struct s_toolbar *tb, GRECT *area)
{
tb->area = *area;
- if (img_toolbar != 0) {
- toolbar_reflow(tb);
- }
+ tb->reflow = true;
}