changeset 723:afbe061b2d66

browser_side (xmlui): allow to select a tab when adding it
author souliane <souliane@mailoo.org>
date Wed, 26 Aug 2015 09:15:56 +0200
parents 242dde89e698
children 994be887e843
files src/browser/sat_browser/xmlui.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser/sat_browser/xmlui.py	Tue Aug 25 14:42:45 2015 +0200
+++ b/src/browser/sat_browser/xmlui.py	Wed Aug 26 09:15:56 2015 +0200
@@ -317,11 +317,12 @@
         TabPanel.__init__(self)
         self.setStyleName('liberviaTabPanel')
 
-    def _xmluiAddTab(self, label):
+    def _xmluiAddTab(self, label, selected):
         tab_panel = VerticalContainer(self)
         self.add(tab_panel, label)
-        if len(self.getChildren()) == 1:
-            self.selectTab(0)
+        count = len(self.getChildren())
+        if count == 1 or selected:
+            self.selectTab(count - 1)
         return tab_panel