# HG changeset patch # User souliane # Date 1425001364 -3600 # Node ID 476d8d9973d3c0f74b0ffd7b4af35b9bf6d44631 # Parent 0b7e4226378db4580de35456fa3800dda8200eb6 browser_side: the contact list's height needs a window resize after it's been added or when the tab bar display is changed diff -r 0b7e4226378d -r 476d8d9973d3 src/browser/libervia_main.py --- a/src/browser/libervia_main.py Fri Feb 27 13:12:28 2015 +0100 +++ b/src/browser/libervia_main.py Fri Feb 27 02:42:44 2015 +0100 @@ -362,6 +362,10 @@ def addContactList(self, dummy): contact_list = ContactList(self) self.panel.addContactList(contact_list) + + # FIXME: the contact list height has to be set manually the first time + self.resize() + return contact_list def newWidget(self, wid): diff -r 0b7e4226378d -r 476d8d9973d3 src/browser/sat_browser/contact_list.py --- 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): diff -r 0b7e4226378d -r 476d8d9973d3 src/browser/sat_browser/libervia_widget.py --- a/src/browser/sat_browser/libervia_widget.py Fri Feb 27 13:12:28 2015 +0100 +++ b/src/browser/sat_browser/libervia_widget.py Fri Feb 27 02:42:44 2015 +0100 @@ -43,7 +43,6 @@ from pyjamas.ui.DropWidget import DropWidget from pyjamas import DOM from pyjamas import Window -from __pyjamas__ import doc import dialog import base_menu @@ -785,6 +784,7 @@ TabPanel.add(self, widget, DropTab(self, label), False) if self.getWidgetCount() > 1: self.tabBar.removeStyleDependentName('oneTab') + self.host.resize() if select: self.selectTab(self.getWidgetCount() - 1) @@ -809,4 +809,5 @@ widgets_count = self.getWidgetCount() if widgets_count == 1: self.tabBar.addStyleDependentName('oneTab') + self.host.resize() self.selectTab(widget_index if widget_index < widgets_count else widgets_count - 1)