diff 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
line wrap: on
line diff
--- a/browser_side/panels.py	Mon Mar 04 00:01:23 2013 +0100
+++ b/browser_side/panels.py	Mon Mar 04 00:19:03 2013 +0100
@@ -1060,10 +1060,13 @@
     def onWidgetPanelRemove(self, panel):
         """ Called when a child WidgetsPanel is empty and need to be removed """
         self.remove(panel)
-        if self.getWidgetCount() == 1:
+        widgets_count = self.getWidgetCount()
+        if widgets_count == 1:
             self.tabBar.setVisible(False)
             self.host.resize()
             self.selectTab(0)
+        else:
+            self.selectTab(widgets_count - 1)
         
 class MainPanel(AbsolutePanel):