comparison src/browser/sat_browser/contact_list.py @ 594:a099990f77a6 frontends_multi_profiles

browser side: border widgets are now visible on drag start + they float right or left in the cell
author Goffi <goffi@goffi.org>
date Fri, 06 Feb 2015 19:11:02 +0100
parents c66f7227848e
children 32dbbc941123
comparison
equal deleted inserted replaced
593:b97c85b8a47e 594:a099990f77a6
71 71
72 72
73 class GroupLabel(base_widget.DragLabel, Label, ClickHandler): 73 class GroupLabel(base_widget.DragLabel, Label, ClickHandler):
74 def __init__(self, host, group): 74 def __init__(self, host, group):
75 self.group = group 75 self.group = group
76 self.host = host
77 Label.__init__(self, group) # , Element=DOM.createElement('div') 76 Label.__init__(self, group) # , Element=DOM.createElement('div')
78 self.setStyleName('group') 77 self.setStyleName('group')
79 base_widget.DragLabel.__init__(self, group, "GROUP") 78 base_widget.DragLabel.__init__(self, group, "GROUP", host)
80 ClickHandler.__init__(self) 79 ClickHandler.__init__(self)
81 self.addClickListener(self) 80 self.addClickListener(self)
82 81
83 def onClick(self, sender): 82 def onClick(self, sender):
84 self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, {'item': self.group}) 83 self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, {'item': self.group})
123 122
124 class ContactBox(VerticalPanel, ClickHandler, base_widget.DragLabel): 123 class ContactBox(VerticalPanel, ClickHandler, base_widget.DragLabel):
125 124
126 def __init__(self, host, jid_, name=None, click_listener=None, handle_menu=None): 125 def __init__(self, host, jid_, name=None, click_listener=None, handle_menu=None):
127 VerticalPanel.__init__(self, StyleName='contactBox', VerticalAlignment='middle') 126 VerticalPanel.__init__(self, StyleName='contactBox', VerticalAlignment='middle')
128 base_widget.DragLabel.__init__(self, jid_, "CONTACT") 127 base_widget.DragLabel.__init__(self, jid_, "CONTACT", host)
129 self.host = host
130 self.jid = jid_ 128 self.jid = jid_
131 self.label = ContactLabel(jid_, name) 129 self.label = ContactLabel(jid_, name)
132 self.avatar = ContactMenuBar(self, host) if handle_menu else Image() 130 self.avatar = ContactMenuBar(self, host) if handle_menu else Image()
133 # self.updateAvatar(host.getAvatar(jid_)) # FIXME 131 # self.updateAvatar(host.getAvatar(jid_)) # FIXME
134 self.add(self.avatar) 132 self.add(self.avatar)
304 302
305 303
306 class ContactTitleLabel(base_widget.DragLabel, Label, ClickHandler): 304 class ContactTitleLabel(base_widget.DragLabel, Label, ClickHandler):
307 def __init__(self, host, text): 305 def __init__(self, host, text):
308 Label.__init__(self, text) # , Element=DOM.createElement('div') 306 Label.__init__(self, text) # , Element=DOM.createElement('div')
309 self.host = host
310 self.setStyleName('contactTitle') 307 self.setStyleName('contactTitle')
311 base_widget.DragLabel.__init__(self, text, "CONTACT_TITLE") 308 base_widget.DragLabel.__init__(self, text, "CONTACT_TITLE", host)
312 ClickHandler.__init__(self) 309 ClickHandler.__init__(self)
313 self.addClickListener(self) 310 self.addClickListener(self)
314 311
315 def onClick(self, sender): 312 def onClick(self, sender):
316 self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, {'item': None}) 313 self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, {'item': None})