diff src/browser/sat_browser/contact_list.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 40c72f3b7638
children 267761bf7f08
line wrap: on
line diff
--- a/src/browser/sat_browser/contact_list.py	Fri Feb 27 13:12:28 2015 +0100
+++ b/src/browser/sat_browser/contact_list.py	Fri Feb 27 02:42:44 2015 +0100
@@ -236,10 +236,10 @@
             self._contacts_panel.setState(jid_, "messageWaiting", True)
 
     def onWindowResized(self, width, height):
-        tab_bar = self.host.panel.tab_panel.getTabBar()
         ideal_height = height - DOM.getAbsoluteTop(self.getElement()) - 5
-        if tab_bar.getVisible():
-            ideal_height -= DOM.getOffsetHeight(tab_bar.getElement())
+        tab_panel = self.host.panel.tab_panel
+        if tab_panel.getWidgetCount() > 1:
+            ideal_height -= tab_panel.getTabBar().getOffsetHeight()
         self.scroll_panel.setHeight("%s%s" % (ideal_height, "px"))
 
     # def updateContact(self, jid_s, attributes, groups):