Mercurial > libervia-web
diff browser_side/richtext.py @ 346:82f9e92379b0
browser_side: move TitlePanel from richtext.py to base_panels.py
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 07 Feb 2014 20:08:28 +0100 |
parents | ce5b33f499c5 |
children | c943fd54c90e |
line wrap: on
line diff
--- a/browser_side/richtext.py Wed Feb 05 16:37:31 2014 +0100 +++ b/browser_side/richtext.py Fri Feb 07 20:08:28 2014 +0100 @@ -26,11 +26,10 @@ from pyjamas.ui.HorizontalPanel import HorizontalPanel from dialog import ConfirmDialog, InfoDialog -from base_panels import ToggleStackPanel +from base_panels import TitlePanel from list_manager import ListManager from sat_frontends.tools import composition -from sat.core.i18n import _ # used for onCloseCallback CANCEL, SYNC_NOT_SAVE, SAVE = xrange(0, 3) @@ -331,19 +330,3 @@ self.registerPopupMenuPanel(entries=composition.RECIPIENT_TYPES, hide=lambda sender, key: self.__children[key]["panel"].isVisible(), callback=self.setContactPanelVisible) - - -class TitlePanel(ToggleStackPanel): - """A toggle panel to set the message title""" - def __init__(self): - ToggleStackPanel.__init__(self, Width="100%") - self.text_area = TextArea() - self.add(self.text_area, _("Title")) - self.addStackChangeListener(self) - - def onStackChanged(self, sender, index, visible=None): - if visible is None: - visible = sender.getWidget(index).getVisible() - text = self.text_area.getText() - suffix = "" if (visible or not text) else (": %s" % text) - sender.setStackText(index, _("Title") + suffix)