comparison cagou/plugins/plugin_wid_chat.py @ 193:284cb5c467b0

core (common): split JidItem in 3 classes: - JidItem to only view an Entity - JidButton to allow to click - JidToggle to select
author Goffi <goffi@goffi.org>
date Wed, 23 May 2018 18:40:58 +0200
parents a826c70beda2
children a3162b29cda1
comparison
equal deleted inserted replaced
192:62198e00a2b7 193:284cb5c467b0
30 from sat_frontends.quick_frontend import quick_widgets 30 from sat_frontends.quick_frontend import quick_widgets
31 from sat_frontends.quick_frontend import quick_chat 31 from sat_frontends.quick_frontend import quick_chat
32 from sat_frontends.tools import jid 32 from sat_frontends.tools import jid
33 from cagou.core import cagou_widget 33 from cagou.core import cagou_widget
34 from cagou.core.image import Image 34 from cagou.core.image import Image
35 from cagou.core.common import SymbolButton, JidItem 35 from cagou.core.common import SymbolButton, JidButton
36 from kivy.uix.dropdown import DropDown 36 from kivy.uix.dropdown import DropDown
37 from kivy.core.window import Window 37 from kivy.core.window import Window
38 from cagou import G 38 from cagou import G
39 import mimetypes 39 import mimetypes
40 40
316 dropdown.clear_widgets() 316 dropdown.clear_widgets()
317 317
318 for jid_, jid_data in comp_data: 318 for jid_, jid_data in comp_data:
319 nick = jid_data.get(u'nick', u'') 319 nick = jid_data.get(u'nick', u'')
320 if text in jid_.bare or text in nick.lower(): 320 if text in jid_.bare or text in nick.lower():
321 btn = JidItem( 321 btn = JidButton(
322 jid = jid_.bare, 322 jid = jid_.bare,
323 profile = profile, 323 profile = profile,
324 size_hint = (0.5, None), 324 size_hint = (0.5, None),
325 nick = nick, 325 nick = nick,
326 on_release=lambda dummy, txt=jid_.bare: self.onHeaderInputCompleted(wid, txt) 326 on_release=lambda dummy, txt=jid_.bare: self.onHeaderInputCompleted(wid, txt)