summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2009-09-06 10:48:14 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2009-09-06 10:48:14 +0000
commitdac634f6fd638b327356f42198ee88ddeef374c9 (patch)
tree369e753aa77b05389054188ee4af32fd35e2ba42 /amiga
parentcd07aa9d3121d56c6b01ba457b6cb2b09744334f (diff)
downloadnetsurf-dac634f6fd638b327356f42198ee88ddeef374c9.tar.gz
netsurf-dac634f6fd638b327356f42198ee88ddeef374c9.tar.bz2
Make throbber operate correctly according to the tab currently displayed.
svn path=/trunk/netsurf/; revision=9547
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/gui.c67
-rwxr-xr-xamiga/gui.h1
2 files changed, 51 insertions, 17 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index 4ff2928e1..cea91c786 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1251,7 +1251,7 @@ ie_qualifier anyway
if(gwin->redraw_required)
ami_do_redraw(gwin);
- if(gwin->throbber_frame)
+ if(gwin->bw->window->throbbing)
ami_update_throbber(gwin,false);
if(gwin->bw->window->c_h)
@@ -2999,43 +2999,76 @@ void gui_window_set_url(struct gui_window *g, const char *url)
void gui_window_start_throbber(struct gui_window *g)
{
struct IBox *bbox;
- GetAttr(SPACE_AreaBox,g->shared->gadgets[GID_THROBBER],(ULONG *)&bbox);
+ ULONG cur_tab = 0;
+
+ if(!g) return;
+
+ if(g->tab_node) GetAttr(CLICKTAB_Current,g->shared->gadgets[GID_TABS],(ULONG *)&cur_tab);
+
+ g->throbbing = true;
+
+ if((cur_tab == g->tab) || (g->shared->tabs == 0))
+ {
+ GetAttr(SPACE_AreaBox,g->shared->gadgets[GID_THROBBER],(ULONG *)&bbox);
- g->shared->throbber_frame=1;
+ if(g->shared->throbber_frame == 0) g->shared->throbber_frame=1;
- BltBitMapRastPort(throbber,throbber_width,0,g->shared->win->RPort,bbox->Left,bbox->Top,throbber_width,throbber_height,0x0C0);
+ BltBitMapRastPort(throbber,throbber_width,0,g->shared->win->RPort,bbox->Left,bbox->Top,throbber_width,throbber_height,0x0C0);
+ }
}
void gui_window_stop_throbber(struct gui_window *g)
{
struct IBox *bbox;
- GetAttr(SPACE_AreaBox,g->shared->gadgets[GID_THROBBER],(ULONG *)&bbox);
+ ULONG cur_tab = 0;
+
+ if(!g) return;
+
+ if(g->tab_node) GetAttr(CLICKTAB_Current, g->shared->gadgets[GID_TABS],
+ (ULONG *)&cur_tab);
- BltBitMapRastPort(throbber,0,0,g->shared->win->RPort,bbox->Left,bbox->Top,throbber_width,throbber_height,0x0C0);
+ g->throbbing = false;
- g->shared->throbber_frame = 0;
+ if((cur_tab == g->tab) || (g->shared->tabs == 0))
+ {
+ GetAttr(SPACE_AreaBox,g->shared->gadgets[GID_THROBBER],(ULONG *)&bbox);
+
+ BltBitMapRastPort(throbber, 0, 0, g->shared->win->RPort, bbox->Left,
+ bbox->Top, throbber_width, throbber_height, 0x0C0);
+ }
+// g->shared->throbber_frame = 0;
}
void ami_update_throbber(struct gui_window_2 *g,bool redraw)
{
struct IBox *bbox;
+ int frame = g->throbber_frame;
+ if(!g) return;
if(!g->gadgets[GID_THROBBER]) return;
- if(!redraw)
+ if(g->bw->window->throbbing == false)
{
- if(g->throbber_update_count < throbber_update_interval)
+ frame = 0;
+ g->throbber_frame=1;
+ }
+ else
+ {
+ if(!redraw)
{
- g->throbber_update_count++;
- return;
- }
+ if(g->throbber_update_count < throbber_update_interval)
+ {
+ g->throbber_update_count++;
+ return;
+ }
- g->throbber_update_count = 0;
+ g->throbber_update_count = 0;
- g->throbber_frame++;
- if(g->throbber_frame > (throbber_frames-1))
- g->throbber_frame=1;
+ g->throbber_frame++;
+ if(g->throbber_frame > (throbber_frames-1))
+ g->throbber_frame=1;
+ }
}
GetAttr(SPACE_AreaBox,g->gadgets[GID_THROBBER],(ULONG *)&bbox);
@@ -3045,7 +3078,7 @@ void ami_update_throbber(struct gui_window_2 *g,bool redraw)
bbox->Left+throbber_width,bbox->Top+throbber_height);
*/
- BltBitMapTags(BLITA_SrcX,throbber_width*g->throbber_frame,
+ BltBitMapTags(BLITA_SrcX, throbber_width * frame,
BLITA_SrcY,0,
BLITA_DestX,bbox->Left,
BLITA_DestY,bbox->Top,
diff --git a/amiga/gui.h b/amiga/gui.h
index 406df6c9f..ef55c8c55 100755
--- a/amiga/gui.h
+++ b/amiga/gui.h
@@ -114,6 +114,7 @@ struct gui_window
int scrolly;
struct history_window *hw;
struct List dllist;
+ bool throbbing;
};
void ami_get_msg(void);