comparison 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
comparison
equal deleted inserted replaced
217:f7ec248192de 218:4e6467efd6bf
145 if wanted and not node.nodeName in wanted: 145 if wanted and not node.nodeName in wanted:
146 raise InvalidXMLUI("ERROR: unexpected nodeName") 146 raise InvalidXMLUI("ERROR: unexpected nodeName")
147 if node.nodeName == "layout": 147 if node.nodeName == "layout":
148 node_type = node.getAttribute('type') 148 node_type = node.getAttribute('type')
149 if node_type == "tabs": 149 if node_type == "tabs":
150 tab_cont = TabPanel() 150 tab_cont = TabPanel()
151 tab_cont.setStyleName('liberviaTabPanel') 151 tab_cont.setStyleName('liberviaTabPanel')
152 tab_cont.setHeight('100%') 152 tab_cont.setHeight('100%')
153 self.__parseChilds(current, node, ['category'], tab_cont) 153 self.__parseChilds(current, node, ['category'], tab_cont)
154 current.append(tab_cont) 154 current.append(tab_cont)
155 if isinstance(current, CellPanel): 155 if isinstance(current, CellPanel):
156 current.setCellHeight(tab_cont, '100%') 156 current.setCellHeight(tab_cont, '100%')
157 if len(tab_cont.getChildren()) > 0:
158 tab_cont.selectTab(0)
157 elif node_type == "vertical": 159 elif node_type == "vertical":
158 self.__parseElems(node, current) 160 self.__parseElems(node, current)
159 elif node_type == "pairs": 161 elif node_type == "pairs":
160 pairs = Pairs() 162 pairs = Pairs()
161 self.__parseElems(node, pairs) 163 self.__parseElems(node, pairs)