# HG changeset patch # User souliane # Date 1403089569 -7200 # Node ID 5911f71acc8059f2ae34e6a548c932b0a55aab3f # Parent ae86b32b959cbcd905aafc2df530e539bf53b7d9 browser side: move contacts list's avatar from right to top diff -r ae86b32b959c -r 5911f71acc80 src/browser/public/libervia.css --- a/src/browser/public/libervia.css Tue Jun 17 17:13:56 2014 +0200 +++ b/src/browser/public/libervia.css Wed Jun 18 13:06:09 2014 +0200 @@ -429,10 +429,16 @@ .contactBox { cursor: pointer; width: 100%; + margin: 5px; + border-radius: 5px; + background: #EDEDED; } .contactBox img { width: 32px; + height: 32px; + border-radius: 5px; + margin: 5px 0px 0px 10px; border-radius: 5px; } diff -r ae86b32b959c -r 5911f71acc80 src/browser/sat_browser/contact.py --- a/src/browser/sat_browser/contact.py Tue Jun 17 17:13:56 2014 +0200 +++ b/src/browser/sat_browser/contact.py Wed Jun 18 13:06:09 2014 +0200 @@ -73,19 +73,13 @@ self.host.getOrCreateLiberviaWidget(panels.MicroblogPanel, self.group) -class ContactLabel(base_widget.DragLabel, HTML, ClickHandler): - def __init__(self, host, jid, name=None, handleClick=True): +class ContactLabel(HTML): + def __init__(self, jid, name=None): HTML.__init__(self) - self.host = host self.name = name or jid self.waiting = False - self.jid = jid self.refresh() self.setStyleName('contactLabel') - base_widget.DragLabel.__init__(self, jid, "CONTACT") - if handleClick: - ClickHandler.__init__(self) - self.addClickListener(self) def refresh(self): if self.waiting: @@ -100,23 +94,21 @@ self.waiting = waiting self.refresh() - def onClick(self, sender): - self.host.getOrCreateLiberviaWidget(panels.ChatPanel, self.jid) - -class ContactBox(HorizontalPanel): +class ContactBox(base_widget.DragLabel, VerticalPanel, ClickHandler): def __init__(self, host, jid, name=None, handleClick=True): - HorizontalPanel.__init__(self, StyleName='contactBox', VerticalAlignment='middle') + VerticalPanel.__init__(self, StyleName='contactBox', VerticalAlignment='middle') + base_widget.DragLabel.__init__(self, jid, "CONTACT") + self.host = host self.jid = jid - self.label = ContactLabel(host, jid, name, handleClick) + self.label = ContactLabel(jid, name) self.avatar = Image() self.updateAvatar(host.getAvatar(jid)) + self.add(self.avatar) self.add(self.label) - spacer = Label(' ') - self.add(spacer) - self.setCellWidth(spacer, '100%') - self.add(self.avatar) - self.setCellHorizontalAlignment(self.avatar, 'right') + if handleClick: + ClickHandler.__init__(self) + self.addClickListener(self) def setMessageWaiting(self, waiting): """Show a visual indicator if message are waiting @@ -132,6 +124,9 @@ self.avatar.setVisible(url != C.DEFAULT_AVATAR) self.avatar.setUrl(url) + def onClick(self, sender): + self.host.getOrCreateLiberviaWidget(panels.ChatPanel, self.jid) + class GroupList(VerticalPanel):