# HG changeset patch # User souliane # Date 1386680627 -3600 # Node ID 1a5dc08c2749f76869951a129e3aef6af6b6bf9f # Parent 89818bca1a339c9018ff3c311de27e60e7d0e682 browser_side: set the ideal width for the rich text dialog when displayed in the unibox panel diff -r 89818bca1a33 -r 1a5dc08c2749 browser_side/panels.py --- a/browser_side/panels.py Tue Dec 10 13:04:51 2013 +0100 +++ b/browser_side/panels.py Tue Dec 10 14:03:47 2013 +0100 @@ -90,6 +90,7 @@ self.host.panel._contactsMove(self) def onCloseCallback(): + Window.removeWindowResizeListener(self) self.host.panel._contactsMove(self.host.panel._hpanel) self.setCellWidth(self.unibox, '100%') self.button.setVisible(True) @@ -97,8 +98,15 @@ self.host.resize() richtext.RichTextEditor.getOrCreate(self.host, self, onCloseCallback) + Window.addWindowResizeListener(self) self.host.resize() + def onWindowResized(self, width, height): + right = self.host.panel.menu.getAbsoluteLeft() + self.host.panel.menu.getOffsetWidth() + left = self.host.panel._contacts.getAbsoluteLeft() + self.host.panel._contacts.getOffsetWidth() + ideal_width = right - left - 40 + self.host.richtext.setWidth("%spx" % ideal_width) + class UniBox(TextArea, MouseHandler): #AutoCompleteTextBox): """This text box is used as a main typing point, for message, microblog, etc""" diff -r 89818bca1a33 -r 1a5dc08c2749 public/libervia.css --- a/public/libervia.css Tue Dec 10 13:04:51 2013 +0100 +++ b/public/libervia.css Tue Dec 10 14:03:47 2013 +0100 @@ -1202,11 +1202,8 @@ /* Rich Text Editor */ .richTextEditor { - width: 600px; - max-width:600px; - min-width: 600px; - margin-top: 9px; - margin-left:18px; + width: 100%; + margin: 9px 18px; } .richTextToolbar {