Mercurial > libervia-desktop-kivy
annotate cagou/plugins/plugin_wid_chat.kv @ 425:13884aac1220
chat: show images in attachments:
- if an image is received from somebody in roster, it is automatically displayed (we
display only for people in roster to avoid IP address leak)
- encrypted files are decrypted and stored in cache before being displayed
- GIFs image are shown as attachment because they are badly handle in Kivy (images
frequencies is not handled correctly, and memory consumption explode). Instead, a click
on it will open the GIF in the appropriate software of the platform.
- a click on an attachment image will open it in the gallery
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 26 Feb 2020 16:47:39 +0100 |
parents | 3e2333a11f61 |
children | d3a6ae859556 |
rev | line source |
---|---|
22 | 1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client |
282 | 2 # Copyright (C) 2016-2019 Jérôme Poisson (goffi@goffi.org) |
22 | 3 |
4 # This program is free software: you can redistribute it and/or modify | |
5 # it under the terms of the GNU Affero General Public License as published by | |
6 # the Free Software Foundation, either version 3 of the License, or | |
7 # (at your option) any later version. | |
8 | |
9 # This program is distributed in the hope that it will be useful, | |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 # GNU Affero General Public License for more details. | |
13 | |
14 # You should have received a copy of the GNU Affero General Public License | |
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | |
104
663e44f30092
chat: added gettext call for hint_text in input
Goffi <goffi@goffi.org>
parents:
103
diff
changeset
|
17 #:import _ sat.core.i18n._ |
116
8576d70ff803
chat: message header is hidden for info messages
Goffi <goffi@goffi.org>
parents:
106
diff
changeset
|
18 #:import C cagou.core.constants.Const |
412 | 19 #:import G cagou.G |
133
c3aa71daceb8
plugin chat: use bold for nicknames in messages headers
Goffi <goffi@goffi.org>
parents:
132
diff
changeset
|
20 #:import escape kivy.utils.escape_markup |
325 | 21 #:import SimpleXHTMLWidget cagou.core.simple_xhtml.SimpleXHTMLWidget |
22 #:import DelayedBoxLayout cagou.core.common_widgets.DelayedBoxLayout | |
326 | 23 #:import ScrollEffect kivy.effects.scroll.ScrollEffect |
394
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
24 #:import CategorySeparator cagou.core.common_widgets.CategorySeparator |
354 | 25 |
26 | |
27 # Chat | |
28 | |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
29 |
425 | 30 <BaseAttachmentItem>: |
411
b018386653c2
chat: work around ScrollView bug in attachments by using a StackLayout instead:
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
31 size_hint: None, None |
b018386653c2
chat: work around ScrollView bug in attachments by using a StackLayout instead:
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
32 size: self.minimum_width, dp(50) |
425 | 33 |
34 | |
35 <AttachmentItem>: | |
412 | 36 canvas.before: |
37 Color: | |
38 rgb: app.c_prim_dark | |
39 RoundedRectangle: | |
40 pos: self.pos | |
41 size: self.size | |
42 Color: | |
43 rgb: 1, 1, 1, 1 | |
44 RoundedRectangle: | |
45 pos: self.x + dp(1), self.y + dp(1) | |
46 size: self.width - dp(2), self.height - dp(2) | |
47 Color: | |
48 rgb: app.c_sec_light | |
49 RoundedRectangle: | |
50 pos: self.x + dp(1), self.y + dp(1) | |
51 size: (self.width - dp(2)) * root.progress / 100, self.height - dp(2) | |
416
3e2333a11f61
common: implemented SymbolToggleLabel:
Goffi <goffi@goffi.org>
parents:
413
diff
changeset
|
52 SymbolButtonLabel: |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
53 symbol: root.get_symbol(root.data) |
412 | 54 color: 0, 0, 0, 1 |
55 text: root.data.get('name', _('unnamed')) | |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
56 bold: False |
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
57 on_press: root.on_press() |
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
58 |
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
59 |
425 | 60 <AttachmentImageItem>: |
61 size: self.minimum_width, self.minimum_height | |
62 image: image | |
63 orientation: "vertical" | |
64 SizedImage: | |
65 id: image | |
66 source: root.data.get('url', root.data.get('path')) | |
67 anim_delay: -1 | |
68 | |
69 | |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
70 <AttachmentsLayout>: |
411
b018386653c2
chat: work around ScrollView bug in attachments by using a StackLayout instead:
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
71 attachments: self |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
72 size_hint: 1, None |
411
b018386653c2
chat: work around ScrollView bug in attachments by using a StackLayout instead:
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
73 height: self.minimum_height |
412 | 74 spacing: dp(5) |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
75 |
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
76 |
44
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
77 <MessAvatar>: |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
78 size_hint: None, None |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
79 size: dp(30), dp(30) |
132
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
80 canvas.before: |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
81 Color: |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
82 rgba: (0.87,0.87,0.87,1) |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
83 RoundedRectangle: |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
84 radius: [dp(5)] |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
85 pos: self.pos |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
86 size: self.size |
44
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
87 |
22 | 88 |
89 <MessageWidget>: | |
24
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
90 size_hint: 1, None |
47
abb81efef3bb
chat: update avatar following quick frontend improvments
Goffi <goffi@goffi.org>
parents:
45
diff
changeset
|
91 avatar: avatar |
103
c601e3d40342
chat: display delivery receipt (with a green check mark)
Goffi <goffi@goffi.org>
parents:
97
diff
changeset
|
92 delivery: delivery |
138 | 93 mess_xhtml: mess_xhtml |
325 | 94 right_part: right_part |
95 header_box: header_box | |
96 height: self.minimum_height | |
45 | 97 BoxLayout: |
138 | 98 orientation: 'vertical' |
99 width: avatar.width | |
100 size_hint: None, 1 | |
45 | 101 MessAvatar: |
102 id: avatar | |
325 | 103 source: (root.mess_data.avatar or '') if root.mess_data else '' |
367
abb57182ebfb
chat: prepend nick to message input when occupant avatar is touched on group chat.
Goffi <goffi@goffi.org>
parents:
354
diff
changeset
|
104 on_press: root.chat.addNick(root.nick) |
138 | 105 Widget: |
106 # use to push the avatar on the top | |
107 size_hint: 1, 1 | |
22 | 108 BoxLayout: |
325 | 109 size_hint: 1, None |
138 | 110 orientation: 'vertical' |
111 id: right_part | |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
112 height: self.minimum_height |
138 | 113 BoxLayout: |
114 id: header_box | |
115 size_hint: 1, None | |
325 | 116 height: time_label.height if root.mess_type != C.MESS_TYPE_INFO else 0 |
117 opacity: 1 if root.mess_type != C.MESS_TYPE_INFO else 0 | |
138 | 118 Label: |
119 id: time_label | |
325 | 120 color: (0, 0, 0, 1) if root.own_mess else (0.55,0.55,0.55,1) |
185
ab3f5173ef5c
chat, simple XHTML: font size adjustement
Goffi <goffi@goffi.org>
parents:
167
diff
changeset
|
121 font_size: root.font_size |
138 | 122 text_size: None, None |
123 size_hint: None, None | |
124 size: self.texture_size | |
125 padding: dp(5), 0 | |
126 markup: True | |
127 valign: 'middle' | |
325 | 128 text: u"[b]{}[/b], {}".format(escape(root.nick), root.time_text) |
138 | 129 Label: |
130 id: delivery | |
274 | 131 color: C.COLOR_BTN_LIGHT |
185
ab3f5173ef5c
chat, simple XHTML: font size adjustement
Goffi <goffi@goffi.org>
parents:
167
diff
changeset
|
132 font_size: root.font_size |
138 | 133 text_size: None, None |
134 size_hint: None, None | |
135 size: self.texture_size | |
136 padding: dp(5), 0 | |
137 # XXX: DejaVuSans font is needed as check mark is not in Roboto | |
138 # this can be removed when Kivy will be able to handle fallback mechanism | |
139 # which will allow us to use fonts with more unicode characters | |
140 font_name: "DejaVuSans" | |
141 text: u'' | |
57 | 142 SimpleXHTMLWidget: |
143 id: mess_xhtml | |
138 | 144 size_hint: 1, None |
58
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
145 height: self.minimum_height |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
146 xhtml: root.message_xhtml or self.escape(root.message or u'') |
325 | 147 color: (0.74,0.74,0.24,1) if root.mess_type == "info" else (0, 0, 0, 1) |
45 | 148 padding: root.mess_padding |
325 | 149 bold: True if root.mess_type == "info" else False |
150 | |
45 | 151 |
412 | 152 <AttachmentToSendItem>: |
153 SymbolButton: | |
154 opacity: 0 if root.sending else 1 | |
155 size_hint: None, 1 | |
156 symbol: "cancel-circled" | |
157 on_press: root.parent.remove_widget(root) | |
158 | |
159 | |
160 <AttachmentsToSend>: | |
161 attachments: attachments_layout.attachments | |
162 orientation: "vertical" | |
163 size_hint: 1, None | |
164 height: self.minimum_height if self.attachments.children else 0 | |
165 opacity: 1 if self.attachments.children else 0 | |
166 padding: [app.MARGIN_LEFT, dp(5), app.MARGIN_RIGHT, dp(5)] | |
167 Label: | |
168 size_hint: 1, None | |
169 size: self.texture_size | |
170 text: _("attachments:") | |
171 bold: True | |
172 AttachmentsLayout: | |
173 id: attachments_layout | |
174 canvas.before: | |
175 Color: | |
176 rgba: app.c_prim | |
177 Rectangle: | |
178 pos: self.pos | |
179 size: self.size | |
180 | |
181 | |
86 | 182 <Chat>: |
412 | 183 attachments_to_send: attachments_to_send |
325 | 184 message_input: message_input |
86 | 185 messages_widget: messages_widget |
326 | 186 history_scroll: history_scroll |
413
c466678c57b2
chat: control send button visibility in core.platform_, and show it when there are attachments
Goffi <goffi@goffi.org>
parents:
412
diff
changeset
|
187 send_button_visible: G.local_platform.send_button_visible or bool(attachments_to_send.attachments.children) |
86 | 188 ScrollView: |
326 | 189 id: history_scroll |
86 | 190 scroll_y: 0 |
326 | 191 on_scroll_y: root.onScroll(*args) |
86 | 192 do_scroll_x: False |
167
ffef21fd97a2
chat: allow to scroll using side bar + increased bar size
Goffi <goffi@goffi.org>
parents:
153
diff
changeset
|
193 scroll_type: ['bars', 'content'] |
326 | 194 bar_width: dp(10) |
195 effect_cls: ScrollEffect | |
325 | 196 DelayedBoxLayout: |
86 | 197 id: messages_widget |
325 | 198 size_hint_y: None |
199 padding: [app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, dp(10)] | |
200 spacing: dp(10) | |
201 height: self.minimum_height | |
202 orientation: 'vertical' | |
412 | 203 AttachmentsToSend: |
204 id: attachments_to_send | |
86 | 205 MessageInputBox: |
78 | 206 size_hint: 1, None |
276 | 207 height: self.minimum_height |
252
fdda914a298b
chat: added some padding in MessageInputBox
Goffi <goffi@goffi.org>
parents:
244
diff
changeset
|
208 spacing: dp(10) |
274 | 209 padding: [app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, dp(10)] |
86 | 210 message_input: message_input |
211 MessageInputWidget: | |
212 id: message_input | |
276 | 213 size_hint: 1, None |
214 height: min(self.minimum_height, dp(250)) | |
215 multiline: True | |
104
663e44f30092
chat: added gettext call for hint_text in input
Goffi <goffi@goffi.org>
parents:
103
diff
changeset
|
216 hint_text: _(u"Enter your message here") |
86 | 217 on_text_validate: root.onSend(args[0]) |
413
c466678c57b2
chat: control send button visibility in core.platform_, and show it when there are attachments
Goffi <goffi@goffi.org>
parents:
412
diff
changeset
|
218 SymbolButton: |
c466678c57b2
chat: control send button visibility in core.platform_, and show it when there are attachments
Goffi <goffi@goffi.org>
parents:
412
diff
changeset
|
219 # "send" button, permanent visibility depends on platform |
c466678c57b2
chat: control send button visibility in core.platform_, and show it when there are attachments
Goffi <goffi@goffi.org>
parents:
412
diff
changeset
|
220 symbol: "forward" |
c466678c57b2
chat: control send button visibility in core.platform_, and show it when there are attachments
Goffi <goffi@goffi.org>
parents:
412
diff
changeset
|
221 size_hint: None, 1 |
c466678c57b2
chat: control send button visibility in core.platform_, and show it when there are attachments
Goffi <goffi@goffi.org>
parents:
412
diff
changeset
|
222 width: dp(30) if root.send_button_visible else 0 |
c466678c57b2
chat: control send button visibility in core.platform_, and show it when there are attachments
Goffi <goffi@goffi.org>
parents:
412
diff
changeset
|
223 opacity: 1 if root.send_button_visible else 0 |
c466678c57b2
chat: control send button visibility in core.platform_, and show it when there are attachments
Goffi <goffi@goffi.org>
parents:
412
diff
changeset
|
224 font_size: dp(25) |
c466678c57b2
chat: control send button visibility in core.platform_, and show it when there are attachments
Goffi <goffi@goffi.org>
parents:
412
diff
changeset
|
225 on_release: self.parent.send_text() |
276 | 226 |
227 | |
278
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
228 # Buttons added in header |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
229 |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
230 <TransferButton>: |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
231 size_hint: None, 1 |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
232 symbol: "plus-circled" |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
233 width: dp(30) |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
234 font_size: dp(25) |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
235 color: 0.4, 0.4, 0.4, 1 |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
236 |
287
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
237 <MenuButton@Button> |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
238 size_hint_y: None |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
239 height: dp(30) |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
240 on_texture_size: self.parent.parent.width = max(self.parent.parent.width, self.texture_size[0] + dp(10)) |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
241 |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
242 <ExtraMenu>: |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
243 auto_width: False |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
244 MenuButton: |
393
e2f806779b53
chat: added a "close" item in menu, to leave MUC/close current chat widget.
Goffi <goffi@goffi.org>
parents:
367
diff
changeset
|
245 text: _("bookmarks") |
287
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
246 on_release: root.select("bookmark") |
393
e2f806779b53
chat: added a "close" item in menu, to leave MUC/close current chat widget.
Goffi <goffi@goffi.org>
parents:
367
diff
changeset
|
247 MenuButton: |
e2f806779b53
chat: added a "close" item in menu, to leave MUC/close current chat widget.
Goffi <goffi@goffi.org>
parents:
367
diff
changeset
|
248 text: _("close") |
e2f806779b53
chat: added a "close" item in menu, to leave MUC/close current chat widget.
Goffi <goffi@goffi.org>
parents:
367
diff
changeset
|
249 on_release: root.select("close") |
287
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
250 |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
251 <ExtraButton>: |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
252 size_hint: None, 1 |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
253 symbol: "dot-3-vert" |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
254 width: dp(30) |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
255 font_size: dp(25) |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
256 color: 0.4, 0.4, 0.4, 1 |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
257 on_release: self.chat.extra_menu.open(self) |
276 | 258 |
233
ba8f3a4a5ac7
plugin chat: e2e encryption improvments:
Goffi <goffi@goffi.org>
parents:
185
diff
changeset
|
259 <EncryptionMainButton>: |
117 | 260 size_hint: None, 1 |
261 width: dp(30) | |
135
091e288838e1
plugin chat: use new Symbol widget to display encryption button
Goffi <goffi@goffi.org>
parents:
133
diff
changeset
|
262 color: self.getColor() |
091e288838e1
plugin chat: use new Symbol widget to display encryption button
Goffi <goffi@goffi.org>
parents:
133
diff
changeset
|
263 symbol: self.getSymbol() |
117 | 264 |
242
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
265 <TrustManagementButton>: |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
266 symbol: "shield" |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
267 padding: dp(5), dp(10) |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
268 bg_color: app.c_prim_dark |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
269 size_hint: None, 1 |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
270 width: dp(30) |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
271 on_release: self.parent.dispatch("on_trust_release") |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
272 |
233
ba8f3a4a5ac7
plugin chat: e2e encryption improvments:
Goffi <goffi@goffi.org>
parents:
185
diff
changeset
|
273 <EncryptionButton>: |
117 | 274 size_hint: None, None |
242
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
275 width: self.parent.parent.best_width if self.parent is not None else 30 |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
276 height: dp(30) |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
277 on_best_width: self.parent.parent.best_width = max(self.parent.parent.best_width, args[1]) |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
278 Button: |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
279 text: root.text |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
280 size_hint: 1, 1 |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
281 padding: dp(5), dp(10) |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
282 color: 0, 0, 0, 1 |
312 | 283 bold: root.bold |
242
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
284 background_normal: app.expand('{media}/misc/borders/border_filled_black.png') |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
285 background_color: app.c_sec if root.selected else app.c_prim_dark |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
286 on_release: root.dispatch("on_release") |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
287 on_texture_size: root.best_width = self.texture_size[0] + (dp(30) if root.trust_button else 0) |
117 | 288 |
233
ba8f3a4a5ac7
plugin chat: e2e encryption improvments:
Goffi <goffi@goffi.org>
parents:
185
diff
changeset
|
289 <EncryptionMenu>: |
117 | 290 size_hint_x: None |
233
ba8f3a4a5ac7
plugin chat: e2e encryption improvments:
Goffi <goffi@goffi.org>
parents:
185
diff
changeset
|
291 width: self.container.minimum_width |
117 | 292 auto_width: False |
293 canvas.before: | |
294 Color: | |
295 rgba: 0, 0, 0, 1 | |
296 Rectangle: | |
297 pos: self.pos | |
298 size: self.size | |
394
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
299 |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
300 |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
301 # Chat Selector |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
302 |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
303 <ChatSelector>: |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
304 jid_selector: jid_selector |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
305 JidSelector: |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
306 id: jid_selector |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
307 on_select: root.on_select(args[1]) |
404
f7476818f9fb
core (common): JidSelector + behaviors various improvments:
Goffi <goffi@goffi.org>
parents:
394
diff
changeset
|
308 to_show: ["opened_chats", "roster", "bookmarks"] |
394
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
309 |