comparison src/browser/sat_browser/libervia_widget.py @ 658:476d8d9973d3 frontends_multi_profiles

browser_side: the contact list's height needs a window resize after it's been added or when the tab bar display is changed
author souliane <souliane@mailoo.org>
date Fri, 27 Feb 2015 02:42:44 +0100
parents 0b7e4226378d
children 8e7d4de56e75
comparison
equal deleted inserted replaced
657:0b7e4226378d 658:476d8d9973d3
41 from pyjamas.ui import HasAlignment 41 from pyjamas.ui import HasAlignment
42 from pyjamas.ui.DragWidget import DragWidget 42 from pyjamas.ui.DragWidget import DragWidget
43 from pyjamas.ui.DropWidget import DropWidget 43 from pyjamas.ui.DropWidget import DropWidget
44 from pyjamas import DOM 44 from pyjamas import DOM
45 from pyjamas import Window 45 from pyjamas import Window
46 from __pyjamas__ import doc
47 46
48 import dialog 47 import dialog
49 import base_menu 48 import base_menu
50 import base_widget 49 import base_widget
51 import base_panel 50 import base_panel
783 @param select (bool): True to select the added tab 782 @param select (bool): True to select the added tab
784 """ 783 """
785 TabPanel.add(self, widget, DropTab(self, label), False) 784 TabPanel.add(self, widget, DropTab(self, label), False)
786 if self.getWidgetCount() > 1: 785 if self.getWidgetCount() > 1:
787 self.tabBar.removeStyleDependentName('oneTab') 786 self.tabBar.removeStyleDependentName('oneTab')
787 self.host.resize()
788 if select: 788 if select:
789 self.selectTab(self.getWidgetCount() - 1) 789 self.selectTab(self.getWidgetCount() - 1)
790 790
791 def addWidgetsTab(self, label, select=False, locked=False): 791 def addWidgetsTab(self, label, select=False, locked=False):
792 """Create a new tab for containing LiberviaWidgets. 792 """Create a new tab for containing LiberviaWidgets.
807 widget_index = self.getWidgetIndex(panel) 807 widget_index = self.getWidgetIndex(panel)
808 self.remove(panel) 808 self.remove(panel)
809 widgets_count = self.getWidgetCount() 809 widgets_count = self.getWidgetCount()
810 if widgets_count == 1: 810 if widgets_count == 1:
811 self.tabBar.addStyleDependentName('oneTab') 811 self.tabBar.addStyleDependentName('oneTab')
812 self.host.resize()
812 self.selectTab(widget_index if widget_index < widgets_count else widgets_count - 1) 813 self.selectTab(widget_index if widget_index < widgets_count else widgets_count - 1)