# HG changeset patch # User Goffi # Date 1473523292 -7200 # Node ID c45d6e9ec73111289da8d1c0b45b83c565acafd2 # Parent fd9cbf6ae6636af1270136031ff3cb61f9988bd6 contact list: fixed contact list display fixed height, and left align everything. diff -r fd9cbf6ae663 -r c45d6e9ec731 src/cagou/plugins/plugin_wid_contact_list.kv --- a/src/cagou/plugins/plugin_wid_contact_list.kv Sat Sep 10 16:01:33 2016 +0200 +++ b/src/cagou/plugins/plugin_wid_contact_list.kv Sat Sep 10 18:01:32 2016 +0200 @@ -14,14 +14,20 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +: + row_height: dp(50) + : - spacing: 20 - Widget: + padding: dp(10), dp(3) + size_hint: 1, None + height: dp(50) Avatar: source: root.data.get('avatar', app.default_avatar) - size_hint: (None, None) + size_hint: None, 1 + width: dp(60) Label: + padding: dp(5), 0 text: root.jid + text_size: self.size bold: True - size_hint: (None, None) - Widget: + valign: "middle" diff -r fd9cbf6ae663 -r c45d6e9ec731 src/cagou/plugins/plugin_wid_contact_list.py --- 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()