diff browser_side/xmlui.py @ 218:4e6467efd6bf

browser_side: small improvements for parameters panel - auto-select the first tab - remove the parameters item if there's nothing to display
author souliane <souliane@mailoo.org>
date Sat, 07 Sep 2013 19:54:41 +0200
parents 9763dec220ed
children e632f77c4219
line wrap: on
line diff
--- a/browser_side/xmlui.py	Sun Sep 08 12:34:00 2013 +0200
+++ b/browser_side/xmlui.py	Sat Sep 07 19:54:41 2013 +0200
@@ -147,13 +147,15 @@
             if node.nodeName == "layout":
                 node_type = node.getAttribute('type')
                 if node_type == "tabs":
-                    tab_cont = TabPanel() 
+                    tab_cont = TabPanel()
                     tab_cont.setStyleName('liberviaTabPanel')
                     tab_cont.setHeight('100%')
                     self.__parseChilds(current, node, ['category'], tab_cont)
                     current.append(tab_cont)
                     if isinstance(current, CellPanel):
                         current.setCellHeight(tab_cont, '100%')
+                    if len(tab_cont.getChildren()) > 0:
+                        tab_cont.selectTab(0)
                 elif node_type == "vertical":
                     self.__parseElems(node, current)
                 elif node_type == "pairs":