Mercurial > libervia-web
comparison src/browser/sat_browser/base_widget.py @ 543:d02335553b5d
browser_side (plugin OTR): display OTR states with icons instead of a text
author | souliane <souliane@mailoo.org> |
---|---|
date | Mon, 08 Sep 2014 15:32:33 +0200 |
parents | 048ae7314156 |
children | 77372641e05d |
comparison
equal
deleted
inserted
replaced
542:fb20b1423143 | 543:d02335553b5d |
---|---|
27 from pyjamas.ui.ScrollPanel import ScrollPanel | 27 from pyjamas.ui.ScrollPanel import ScrollPanel |
28 from pyjamas.ui.FlexTable import FlexTable | 28 from pyjamas.ui.FlexTable import FlexTable |
29 from pyjamas.ui.TabPanel import TabPanel | 29 from pyjamas.ui.TabPanel import TabPanel |
30 from pyjamas.ui.HTMLPanel import HTMLPanel | 30 from pyjamas.ui.HTMLPanel import HTMLPanel |
31 from pyjamas.ui.Label import Label | 31 from pyjamas.ui.Label import Label |
32 from pyjamas.ui.HTML import HTML | |
32 from pyjamas.ui.Button import Button | 33 from pyjamas.ui.Button import Button |
33 from pyjamas.ui.Widget import Widget | 34 from pyjamas.ui.Widget import Widget |
34 from pyjamas.ui.DragWidget import DragWidget | 35 from pyjamas.ui.DragWidget import DragWidget |
35 from pyjamas.ui.DropWidget import DropWidget | 36 from pyjamas.ui.DropWidget import DropWidget |
36 from pyjamas.ui.ClickListener import ClickHandler | 37 from pyjamas.ui.ClickListener import ClickHandler |
202 | 203 |
203 def __init__(self, parent, host, title, info=None): | 204 def __init__(self, parent, host, title, info=None): |
204 """ | 205 """ |
205 @param parent (LiberviaWidget): LiberWidget instance | 206 @param parent (LiberviaWidget): LiberWidget instance |
206 @param host (SatWebFrontend): SatWebFrontend instance | 207 @param host (SatWebFrontend): SatWebFrontend instance |
207 @param title (Widget): text widget instance | 208 @param title (Label, HTML): text widget instance |
208 @param info (Widget): text widget instance | 209 @param info (Widget): text widget instance |
209 """ | 210 """ |
210 AbsolutePanel.__init__(self) | 211 AbsolutePanel.__init__(self) |
211 self.add(title) | 212 self.add(title) |
212 if info: | 213 if info: |
242 self.__setting_button_id = HTMLPanel.createUniqueId() | 243 self.__setting_button_id = HTMLPanel.createUniqueId() |
243 self.__close_button_id = HTMLPanel.createUniqueId() | 244 self.__close_button_id = HTMLPanel.createUniqueId() |
244 self.__title = Label(title) | 245 self.__title = Label(title) |
245 self.__title.setStyleName('widgetHeader_title') | 246 self.__title.setStyleName('widgetHeader_title') |
246 if info: | 247 if info: |
247 self.__info = Label(info) | 248 self.__info = HTML(info) |
248 self.__info.setStyleName('widgetHeader_info') | 249 self.__info.setStyleName('widgetHeader_info') |
249 else: | 250 else: |
250 self.__info = None | 251 self.__info = None |
251 self._close_listeners = [] | 252 self._close_listeners = [] |
252 header = WidgetHeader(self, host, self.__title, self.__info) | 253 header = WidgetHeader(self, host, self.__title, self.__info) |
390 | 391 |
391 def setHeaderInfo(self, text): | 392 def setHeaderInfo(self, text): |
392 """change the info in the header of the widget | 393 """change the info in the header of the widget |
393 @param text: text of the new title""" | 394 @param text: text of the new title""" |
394 try: | 395 try: |
395 self.__info.setText(text) | 396 self.__info.setHTML(text) |
396 except AttributeError: | 397 except AttributeError: |
397 log.error("LiberviaWidget.setInfo: info widget has not been initialized!") | 398 log.error("LiberviaWidget.setInfo: info widget has not been initialized!") |
398 | 399 |
399 def isSelectable(self): | 400 def isSelectable(self): |
400 return self.__selectable | 401 return self.__selectable |