comparison src/browser/sat_browser/contact_list.py @ 654:40c72f3b7638 frontends_multi_profiles

browser_side: MainPanel is now based on a DockPanel, which allows to use less tables and also to remove some "window resized" listeners
author souliane <souliane@mailoo.org>
date Fri, 27 Feb 2015 02:39:43 +0100
parents 2df91d0308ac
children 476d8d9973d3
comparison
equal deleted inserted replaced
653:e1d067378ad3 654:40c72f3b7638
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 contact_panel_elt = self.getElement() 239 tab_bar = self.host.panel.tab_panel.getTabBar()
240 # FIXME: still needed ? 240 ideal_height = height - DOM.getAbsoluteTop(self.getElement()) - 5
241 # classname = 'widgetsPanel' if isinstance(self.getParent().getParent(), panels.UniBoxPanel) else 'gwt-TabBar' 241 if tab_bar.getVisible():
242 classname = 'gwt-TabBar' 242 ideal_height -= DOM.getOffsetHeight(tab_bar.getElement())
243 _elts = doc().getElementsByClassName(classname)
244 if not _elts.length:
245 log.error("no element of class %s found, it should exist !" % classname)
246 tab_bar_h = height
247 else:
248 tab_bar_h = DOM.getAbsoluteTop(_elts.item(0)) or height # getAbsoluteTop can be 0 if tabBar is hidden
249
250 ideal_height = tab_bar_h - DOM.getAbsoluteTop(contact_panel_elt) - 5
251 self.scroll_panel.setHeight("%s%s" % (ideal_height, "px")) 243 self.scroll_panel.setHeight("%s%s" % (ideal_height, "px"))
252 244
253 # def updateContact(self, jid_s, attributes, groups): 245 # def updateContact(self, jid_s, attributes, groups):
254 # """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
255 247