comparison cagou/plugins/plugin_wid_chat.kv @ 394:d15828ca9d86

chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector: - "implicit_update" is used to avoid double update on init - "to_show" is used to show opened chats, roster and bookmarks - update jid_selector when pre_entering the chat selector
author Goffi <goffi@goffi.org>
date Thu, 06 Feb 2020 21:16:21 +0100
parents e2f806779b53
children f7476818f9fb
comparison
equal deleted inserted replaced
393:e2f806779b53 394:d15828ca9d86
18 #:import C cagou.core.constants.Const 18 #:import C cagou.core.constants.Const
19 #:import escape kivy.utils.escape_markup 19 #:import escape kivy.utils.escape_markup
20 #:import SimpleXHTMLWidget cagou.core.simple_xhtml.SimpleXHTMLWidget 20 #:import SimpleXHTMLWidget cagou.core.simple_xhtml.SimpleXHTMLWidget
21 #:import DelayedBoxLayout cagou.core.common_widgets.DelayedBoxLayout 21 #:import DelayedBoxLayout cagou.core.common_widgets.DelayedBoxLayout
22 #:import ScrollEffect kivy.effects.scroll.ScrollEffect 22 #:import ScrollEffect kivy.effects.scroll.ScrollEffect
23 23 #:import CategorySeparator cagou.core.common_widgets.CategorySeparator
24
25 # Chat Selector
26
27 <ChatSelector>:
28 JidSelector:
29 on_select: root.on_select(args[1])
30 24
31 25
32 # Chat 26 # Chat
33 27
34 <MessAvatar>: 28 <MessAvatar>:
217 Color: 211 Color:
218 rgba: 0, 0, 0, 1 212 rgba: 0, 0, 0, 1
219 Rectangle: 213 Rectangle:
220 pos: self.pos 214 pos: self.pos
221 size: self.size 215 size: self.size
216
217
218 # Chat Selector
219
220 <ChatSelector>:
221 jid_selector: jid_selector
222 JidSelector:
223 id: jid_selector
224 # we call update() explicitly in on_pre_enter
225 implicit_update: False
226 on_select: root.on_select(args[1])
227 to_show:
228 [
229 CategorySeparator(text=_("Opened chats")),
230 "opened_chats",
231 CategorySeparator(text=_("Your contacts")),
232 "roster",
233 CategorySeparator(text=_("Your chat rooms")),
234 "bookmarks",
235 ]
236