# HG changeset patch # User souliane # Date 1388404841 -3600 # Node ID 5ad70625867a4904cd71f1fa7ca6fcbd86554313 # Parent b4781a350483e178edcb4b73e150bc6fbda586dd browser_side: save the unibox panel space when unibox is disabled diff -r b4781a350483 -r 5ad70625867a browser_side/panels.py --- a/browser_side/panels.py Mon Dec 30 00:33:19 2013 +0100 +++ b/browser_side/panels.py Mon Dec 30 13:00:41 2013 +0100 @@ -76,6 +76,7 @@ def setUniBox(self, enable): """Enable or disable the unibox widget. @param enable: boolean + @return: UniBox instance or None if disabled """ if enable: self.button = Button ('') @@ -87,10 +88,12 @@ self.setCellWidth(self.unibox, '100%') self.button.addClickListener(self.openRichTextEditor) self.unibox.addKey("@@: ") + return self.unibox else: if self.unibox: self.remove(self.unibox) self.unibox = None + return None def openRichTextEditor(self): """Open the rich text editor.""" @@ -1261,6 +1264,7 @@ # unibox self.unibox_panel = UniBoxPanel(host) + self.unibox_panel.setVisible(False) # status bar status = host.status_panel @@ -1323,6 +1327,14 @@ ideal_height = Window.getClientHeight() - tab_bar_h self.setHeight("%s%s" % (ideal_height, "px")) + def setUniBoxPanel(self, enable): + """Enable or disable the unibox + @param enable: boolean + @return: UniBox instance or None if disabled + """ + self.unibox_panel.setVisible(enable) + return self.unibox_panel.setUniBox(enable) + class PopupMenuPanel(PopupPanel): """This implementation of a popup menu (context menu) allow you to assign diff -r b4781a350483 -r 5ad70625867a libervia.py --- a/libervia.py Mon Dec 30 00:33:19 2013 +0100 +++ b/libervia.py Mon Dec 30 13:00:41 2013 +0100 @@ -263,8 +263,7 @@ """Enable or disable the unibox widget. @param enable: boolean """ - self.panel.unibox_panel.setUniBox(enable == 'true') - self.uni_box = self.panel.unibox_panel.unibox + self.uni_box = self.panel.setUniBoxPanel(enable == 'true') def addTab(self, label, wid, select=True): """Create a new tab and eventually add a widget in