diff src/cagou/plugins/plugin_wid_contact_list.py @ 50:c45d6e9ec731

contact list: fixed contact list display fixed height, and left align everything.
author Goffi <goffi@goffi.org>
date Sat, 10 Sep 2016 18:01:32 +0200
parents b9ee3bf81018
children 9a6121722669
line wrap: on
line diff
--- a/src/cagou/plugins/plugin_wid_contact_list.py	Sat Sep 10 16:01:33 2016 +0200
+++ b/src/cagou/plugins/plugin_wid_contact_list.py	Sat Sep 10 18:01:32 2016 +0200
@@ -50,7 +50,7 @@
     jid = properties.StringProperty('')
 
     def __init__(self, **kwargs):
-        BoxLayout.__init__(self, **kwargs)
+        super(ContactItem, self).__init__(**kwargs)
 
     def on_touch_down(self, touch):
         if self.collide_point(*touch.pos):
@@ -67,6 +67,9 @@
                 G.host.switchWidget(self, factory(plg_infos, jid.JID(self.jid), profiles=iter(G.host.profiles)))
 
 
+class ContactListView(ListView):
+    pass
+
 
 class ContactList(QuickContactList, cagou_widget.CagouWidget):
 
@@ -79,7 +82,7 @@
                                    selection_mode='multiple',
                                    allow_empty_selection=True,
                                   )
-        self.add_widget(ListView(adapter=self.adapter))
+        self.add_widget(ContactListView(adapter=self.adapter))
         self.postInit()
         self.update()
 
@@ -87,9 +90,9 @@
         return {"jid": bare_jid, "data": self._items_cache[bare_jid]}
 
     def update(self, entities=None, type_=None, profile=None):
-        log.info("update: %s %s %s" % (entities, type_, profile))
+        log.debug("update: %s %s %s" % (entities, type_, profile))
         # FIXME: for now we update on each event
         # if entities is None and type_ is None:
-        self._items_cache = self.items
-        self.adapter.data = self.items_sorted
+        self._items_cache = self.items_sorted
+        self.adapter.data = self.items_sorted.keys()