comparison 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
comparison
equal deleted inserted replaced
657:0b7e4226378d 658:476d8d9973d3
234 234
235 for jid_ in self._alerts: 235 for jid_ in self._alerts:
236 self._contacts_panel.setState(jid_, "messageWaiting", True) 236 self._contacts_panel.setState(jid_, "messageWaiting", True)
237 237
238 def onWindowResized(self, width, height): 238 def onWindowResized(self, width, height):
239 tab_bar = self.host.panel.tab_panel.getTabBar()
240 ideal_height = height - DOM.getAbsoluteTop(self.getElement()) - 5 239 ideal_height = height - DOM.getAbsoluteTop(self.getElement()) - 5
241 if tab_bar.getVisible(): 240 tab_panel = self.host.panel.tab_panel
242 ideal_height -= DOM.getOffsetHeight(tab_bar.getElement()) 241 if tab_panel.getWidgetCount() > 1:
242 ideal_height -= tab_panel.getTabBar().getOffsetHeight()
243 self.scroll_panel.setHeight("%s%s" % (ideal_height, "px")) 243 self.scroll_panel.setHeight("%s%s" % (ideal_height, "px"))
244 244
245 # def updateContact(self, jid_s, attributes, groups): 245 # def updateContact(self, jid_s, attributes, groups):
246 # """Add a contact to the panel if it doesn't exist, update it else 246 # """Add a contact to the panel if it doesn't exist, update it else
247 247