comparison frontends/primitivus/contact_list.py @ 192:879beacb8e16

Primitivus: major changes in SelectableText, menu can now be used with mouse, TabsContainer show wich tab is selected - SelectableText is a WidgetWrap of urwid.Text, and manage attributes and complexe combination like urwid.Text (list of tuples (attribute,text)) - Menu now use a ColumnsRoller, and can't anymore be displayed on 2 rows, avoiding potential bug when display MenuBox - Mouse can be used in menu. Right click on MenuBox make it disappear - Tab container now display which tab is selected by putting a 'title' attribute on the corresponding button /!\ as SelectableText is heavily used, there can be regressions
author Goffi <goffi@goffi.org>
date Thu, 19 Aug 2010 21:11:22 +0800
parents 8ea1510d474b
children 9e7bc7f09221
comparison
equal deleted inserted replaced
191:1438a1337732 192:879beacb8e16
93 jid=JID(contact) 93 jid=JID(contact)
94 name = self.CM.getAttr(jid,'name') 94 name = self.CM.getAttr(jid,'name')
95 nick = self.CM.getAttr(jid,'nick') 95 nick = self.CM.getAttr(jid,'nick')
96 display = nick or name or jid.node or jid.short 96 display = nick or name or jid.node or jid.short
97 header = '(*) ' if contact in self.alert_jid else '' 97 header = '(*) ' if contact in self.alert_jid else ''
98 widget = custom_widgets.SelectableText(display, selected = contact==self.selected, header=header, data=contact) 98 widget = custom_widgets.SelectableText(display, selected = contact==self.selected, header=header)
99 widget.data = contact
99 if contact in self.alert_jid: 100 if contact in self.alert_jid:
100 widget.setAttribute('default','alert') 101 widget.setAttribute('default','alert')
101 content.append(widget) 102 content.append(widget)
102 urwid.connect_signal(widget, 'change', self.__contactClicked) 103 urwid.connect_signal(widget, 'change', self.__contactClicked)
103 104