comparison browser_side/panels.py @ 194:6198be95a39c

browser side: new tab is automatically selected, if a tab is removed, the last one is automatically selected bug 6 (additionnal comment)
author Goffi <goffi@goffi.org>
date Mon, 04 Mar 2013 00:19:03 +0100
parents f2ae8e170c49
children dd27072d8ae0
comparison
equal deleted inserted replaced
193:f2ae8e170c49 194:6198be95a39c
1058 self.host.resize() 1058 self.host.resize()
1059 1059
1060 def onWidgetPanelRemove(self, panel): 1060 def onWidgetPanelRemove(self, panel):
1061 """ Called when a child WidgetsPanel is empty and need to be removed """ 1061 """ Called when a child WidgetsPanel is empty and need to be removed """
1062 self.remove(panel) 1062 self.remove(panel)
1063 if self.getWidgetCount() == 1: 1063 widgets_count = self.getWidgetCount()
1064 if widgets_count == 1:
1064 self.tabBar.setVisible(False) 1065 self.tabBar.setVisible(False)
1065 self.host.resize() 1066 self.host.resize()
1066 self.selectTab(0) 1067 self.selectTab(0)
1068 else:
1069 self.selectTab(widgets_count - 1)
1067 1070
1068 class MainPanel(AbsolutePanel): 1071 class MainPanel(AbsolutePanel):
1069 1072
1070 def __init__(self, host): 1073 def __init__(self, host):
1071 self.host=host 1074 self.host=host