From 90e6cf85b68df8ec84d67bfb5f48b05446142f07 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 25 Oct 2014 15:23:31 +0100 Subject: Toggle vscroll on/off as needed --- amiga/gui.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'amiga/gui.c') diff --git a/amiga/gui.c b/amiga/gui.c index 558852a7a..9e7a92bb6 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2588,6 +2588,7 @@ void ami_switch_tab(struct gui_window_2 *gwin,bool redraw) browser_window_refresh_url_bar(gwin->bw); ami_gui_update_hotlist_button(gwin); + ami_gui_vscroll_update(gwin); ami_throbber_redraw_schedule(0, gwin->bw->window); } } @@ -3092,6 +3093,23 @@ static void ami_gui_vscroll_remove(struct gui_window_2 *gwin) gwin->objects[GID_VSCROLL] = NULL; } +static void ami_gui_vscroll_update(struct gui_window_2 *gwin) +{ + browser_scrolling hscroll = BW_SCROLLING_YES; + browser_scrolling vscroll = BW_SCROLLING_YES; + + browser_window_get_scrollbar_type(gwin->bw, &hscroll, &vscroll); + + /* We only bother with vscroll, as the hscroller is embedded in the + bottom window border with the status bar, so toggling it is pointless */ + + if(vscroll == BW_SCROLLING_NO) { + ami_gui_vscroll_remove(gwin); + } else { + ami_gui_vscroll_add(gwin); + } +} + void ami_toggletabbar(struct gui_window_2 *gwin, bool show) { if(ClickTabBase->lib_Version < 53) return; @@ -3831,8 +3849,6 @@ gui_window_create(struct browser_window *bw, ScreenToFront(scrn); -ami_gui_vscroll_add(g->shared); - return g; } @@ -4878,6 +4894,7 @@ static void gui_window_new_content(struct gui_window *g) ami_plot_release_pens(&g->shared->shared_pens); ami_menu_update_disabled(g, c); ami_gui_update_hotlist_button(g->shared); + ami_gui_vscroll_update(g->shared); } static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type, -- cgit v1.2.3