From 1f96c0a413c26db03cd2921ef795972c47997747 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 10 Sep 2016 20:36:11 +0100 Subject: Add an ACTIVE switch to the OPEN ARexx command to force new tabs to be active --- frontends/amiga/gui.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'frontends/amiga/gui.c') diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index 9aaf182ee..0a324ca68 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -3476,6 +3476,19 @@ void ami_gui_set_scale(struct gui_window *gw, float scale) browser_window_set_scale(gw->bw, scale, true); } +void ami_gui_switch_to_new_tab(struct gui_window_2 *gwin) +{ + if(nsoption_bool(new_tab_is_active) == true) return; + + /* Switch to the just-opened tab (if new_tab_is_active, we already did!) */ + RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_TABS], + gwin->win, NULL, + CLICKTAB_CurrentNode, gwin->last_new_tab, + TAG_DONE); + + ami_switch_tab(gwin, false); +} + nserror ami_gui_new_blank_tab(struct gui_window_2 *gwin) { nsurl *url; @@ -3497,15 +3510,7 @@ nserror ami_gui_new_blank_tab(struct gui_window_2 *gwin) return error; } - if(nsoption_bool(new_tab_is_active) == false) { - /* Because this is a new blank tab, switch to it (if new_tab_is_active, we already did!) */ - RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_TABS], - gwin->win, NULL, - CLICKTAB_CurrentNode, gwin->last_new_tab, - TAG_DONE); - - ami_switch_tab(gwin, false); - } + ami_gui_switch_to_new_tab(gwin); return NSERROR_OK; } -- cgit v1.2.3