aboutsummaryrefslogtreecommitdiff
path: root/src/uicmd.cc
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2012-12-14 08:07:21 -0300
committerJorge Arellano Cid <jcid@dillo.org>2012-12-14 08:07:21 -0300
commitfb51b13def5271ad643f18de5e7c4cb8d32228f6 (patch)
treed433e389003a4df3e87b6e78d2f1f9024421f006 /src/uicmd.cc
parent6442d8c2cdae9addb0012fe9b79375f459f500bf (diff)
Update focus priority number for tabs opened in background
There're two options: update the focus number so when you close the current tab, focus goes to the last background-opened tab (as with this patch), or to leave it low so when you close the current tab, focus goes to the previous non-background tab.
Diffstat (limited to 'src/uicmd.cc')
-rw-r--r--src/uicmd.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/uicmd.cc b/src/uicmd.cc
index 20d32519..de90748f 100644
--- a/src/uicmd.cc
+++ b/src/uicmd.cc
@@ -289,9 +289,15 @@ UI *CustTabs::add_new_tab(UI *old_ui, int focus)
if (focus) {
switch_tab(btn);
- } else if (num_tabs() == 2) {
- // no focus and tabbar added: redraw current page
- Wizard->redraw();
+ } else { // no focus
+ // set focus counter
+ increase_focus_counter();
+ btn->focus_num(focus_counter);
+
+ if (num_tabs() == 2) {
+ // tabbar added: redraw current page
+ Wizard->redraw();
+ }
}
if (num_tabs() == 1)
btn->hide();