diff browser_side/panels.py @ 311:3135ff840b8e

browser_side: message box below the ChatPanel when unibox is disabled
author souliane <souliane@mailoo.org>
date Mon, 30 Dec 2013 00:30:45 +0100
parents 5d11ec1f2c22
children b4781a350483
line wrap: on
line diff
--- a/browser_side/panels.py	Sun Dec 29 23:15:35 2013 +0100
+++ b/browser_side/panels.py	Mon Dec 30 00:30:45 2013 +0100
@@ -975,9 +975,20 @@
         chat_area.add(self.content_scroll)
         chat_area.setCellWidth(self.content_scroll, '100%')
         self.vpanel.add(self.__body)
+        self.vpanel.setCellHeight(self.__body, '100%')
         self.addStyleName('chatPanel')
         self.setWidget(self.vpanel)
         self.state_machine = ChatStateMachine(self.host, str(self.target))
+        self.setUniBox(self.host.uni_box)
+
+    def setUniBox(self, enable):
+        """Enable or disable the unibox. If it is disabled,
+        display a message box below the panel."""
+        if enable:
+            return
+        message_box = MessageBox(self.host)
+        message_box.onSelectedChange(self)
+        self.vpanel.add(message_box)
 
     """def doDetachChildren(self):
         #We need to force the use of a panel subclass method here,