Mercurial > libervia-desktop-kivy
annotate libervia/desktop_kivy/plugins/plugin_wid_chat.kv @ 514:d78728d7fd6a
plugin wid calls, core: implements WebRTC DataChannel file transfer:
- Add a new "file" icon in call UI to send a file via WebRTC.
- Handle new preflight mechanism, and WebRTC file transfer.
- Native file chooser handling has been moved to new `core.file_chooser` module, and now
supports "save" and "dir" modes (based on `plyer`).
rel 442
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 06 Apr 2024 13:37:27 +0200 |
parents | b3cedbee561d |
children | 196483685a63 |
rev | line source |
---|---|
493
b3cedbee561d
refactoring: rename `cagou` to `libervia.desktop_kivy` + update imports and names following backend changes
Goffi <goffi@goffi.org>
parents:
491
diff
changeset
|
1 #Libervia Desktop-Kivy |
461 | 2 # Copyright (C) 2016-2021 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 | |
493
b3cedbee561d
refactoring: rename `cagou` to `libervia.desktop_kivy` + update imports and names following backend changes
Goffi <goffi@goffi.org>
parents:
491
diff
changeset
|
17 #:import _ libervia.backend.core.i18n._ |
b3cedbee561d
refactoring: rename `cagou` to `libervia.desktop_kivy` + update imports and names following backend changes
Goffi <goffi@goffi.org>
parents:
491
diff
changeset
|
18 #:import C libervia.desktop_kivy.core.constants.Const |
b3cedbee561d
refactoring: rename `cagou` to `libervia.desktop_kivy` + update imports and names following backend changes
Goffi <goffi@goffi.org>
parents:
491
diff
changeset
|
19 #:import G libervia.desktop_kivy.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 |
493
b3cedbee561d
refactoring: rename `cagou` to `libervia.desktop_kivy` + update imports and names following backend changes
Goffi <goffi@goffi.org>
parents:
491
diff
changeset
|
21 #:import SimpleXHTMLWidget libervia.desktop_kivy.core.simple_xhtml.SimpleXHTMLWidget |
b3cedbee561d
refactoring: rename `cagou` to `libervia.desktop_kivy` + update imports and names following backend changes
Goffi <goffi@goffi.org>
parents:
491
diff
changeset
|
22 #:import DelayedBoxLayout libervia.desktop_kivy.core.common_widgets.DelayedBoxLayout |
326 | 23 #:import ScrollEffect kivy.effects.scroll.ScrollEffect |
493
b3cedbee561d
refactoring: rename `cagou` to `libervia.desktop_kivy` + update imports and names following backend changes
Goffi <goffi@goffi.org>
parents:
491
diff
changeset
|
24 #:import CategorySeparator libervia.desktop_kivy.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 | |
434
977158b56ce6
chat: use a Line instead of 2 RoundedRectangle for decoration
Goffi <goffi@goffi.org>
parents:
433
diff
changeset
|
39 Line: |
977158b56ce6
chat: use a Line instead of 2 RoundedRectangle for decoration
Goffi <goffi@goffi.org>
parents:
433
diff
changeset
|
40 rounded_rectangle: self.x + dp(1), self.y + dp(1), self.width - dp(2), self.height - dp(2), 10 |
412 | 41 Color: |
42 rgb: app.c_sec_light | |
43 RoundedRectangle: | |
44 pos: self.x + dp(1), self.y + dp(1) | |
45 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
|
46 SymbolButtonLabel: |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
47 symbol: root.get_symbol(root.data) |
412 | 48 color: 0, 0, 0, 1 |
49 text: root.data.get('name', _('unnamed')) | |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
50 bold: False |
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
51 on_press: root.on_press() |
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
52 |
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
53 |
425 | 54 <AttachmentImageItem>: |
55 size: self.minimum_width, self.minimum_height | |
56 image: image | |
57 orientation: "vertical" | |
58 SizedImage: | |
59 id: image | |
60 anim_delay: -1 | |
447
f3296a7f35f3
chat: use "image-loading" animation as default source for AttachmentImageItem
Goffi <goffi@goffi.org>
parents:
441
diff
changeset
|
61 source: "data/images/image-loading.gif" |
425 | 62 |
63 | |
426
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
64 <AttachmentImagesCollectionItem>: |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
65 cols: 2 |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
66 size_hint: None, None |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
67 size: dp(150), dp(150) |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
68 padding: dp(5) |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
69 spacing: dp(2) |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
70 canvas.before: |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
71 Color: |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
72 rgb: app.c_prim |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
73 RoundedRectangle: |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
74 radius: [dp(5)] |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
75 pos: self.pos |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
76 size: self.size |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
77 Color: |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
78 rgb: 0, 0, 0, 1 |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
79 Line: |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
80 rounded_rectangle: self.x, self.y, self.width, self.height, dp(5) |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
81 |
d3a6ae859556
chat: image attachments collection, first draft:
Goffi <goffi@goffi.org>
parents:
425
diff
changeset
|
82 |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
83 <AttachmentsLayout>: |
411
b018386653c2
chat: work around ScrollView bug in attachments by using a StackLayout instead:
Goffi <goffi@goffi.org>
parents:
409
diff
changeset
|
84 attachments: self |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
85 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
|
86 height: self.minimum_height |
412 | 87 spacing: dp(5) |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
88 |
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
89 |
44
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
90 <MessAvatar>: |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
91 size_hint: None, None |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
92 size: dp(30), dp(30) |
132
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
93 canvas.before: |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
94 Color: |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
95 rgba: (0.87,0.87,0.87,1) |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
96 RoundedRectangle: |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
97 radius: [dp(5)] |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
98 pos: self.pos |
7ad965999d47
plugin chat: draw a background for avatars
Goffi <goffi@goffi.org>
parents:
131
diff
changeset
|
99 size: self.size |
44
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
100 |
22 | 101 |
102 <MessageWidget>: | |
24
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
103 size_hint: 1, None |
47
abb81efef3bb
chat: update avatar following quick frontend improvments
Goffi <goffi@goffi.org>
parents:
45
diff
changeset
|
104 avatar: avatar |
103
c601e3d40342
chat: display delivery receipt (with a green check mark)
Goffi <goffi@goffi.org>
parents:
97
diff
changeset
|
105 delivery: delivery |
138 | 106 mess_xhtml: mess_xhtml |
325 | 107 right_part: right_part |
108 header_box: header_box | |
109 height: self.minimum_height | |
45 | 110 BoxLayout: |
138 | 111 orientation: 'vertical' |
112 width: avatar.width | |
113 size_hint: None, 1 | |
45 | 114 MessAvatar: |
115 id: avatar | |
458
1dd6db69406a
core: update avatar handling following backend changes:
Goffi <goffi@goffi.org>
parents:
449
diff
changeset
|
116 source: root.mess_data.avatar['path'] if root.mess_data and root.mess_data.avatar else app.default_avatar |
491
203755bbe0fe
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
461
diff
changeset
|
117 on_press: root.chat.add_nick(root.nick) |
138 | 118 Widget: |
119 # use to push the avatar on the top | |
120 size_hint: 1, 1 | |
22 | 121 BoxLayout: |
325 | 122 size_hint: 1, None |
138 | 123 orientation: 'vertical' |
124 id: right_part | |
409
2caea63ae2ab
chat: show attachments as clickable icons
Goffi <goffi@goffi.org>
parents:
406
diff
changeset
|
125 height: self.minimum_height |
138 | 126 BoxLayout: |
127 id: header_box | |
128 size_hint: 1, None | |
325 | 129 height: time_label.height if root.mess_type != C.MESS_TYPE_INFO else 0 |
130 opacity: 1 if root.mess_type != C.MESS_TYPE_INFO else 0 | |
138 | 131 Label: |
132 id: time_label | |
325 | 133 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
|
134 font_size: root.font_size |
138 | 135 text_size: None, None |
136 size_hint: None, None | |
137 size: self.texture_size | |
138 padding: dp(5), 0 | |
139 markup: True | |
140 valign: 'middle' | |
325 | 141 text: u"[b]{}[/b], {}".format(escape(root.nick), root.time_text) |
449
6c21a5a44b54
chat: show a padlock icon to indicate if message is e2e encrypted or not:
Goffi <goffi@goffi.org>
parents:
448
diff
changeset
|
142 Symbol: |
6c21a5a44b54
chat: show a padlock icon to indicate if message is e2e encrypted or not:
Goffi <goffi@goffi.org>
parents:
448
diff
changeset
|
143 size_hint_x: None |
6c21a5a44b54
chat: show a padlock icon to indicate if message is e2e encrypted or not:
Goffi <goffi@goffi.org>
parents:
448
diff
changeset
|
144 width: self.height |
6c21a5a44b54
chat: show a padlock icon to indicate if message is e2e encrypted or not:
Goffi <goffi@goffi.org>
parents:
448
diff
changeset
|
145 id: encrypted |
6c21a5a44b54
chat: show a padlock icon to indicate if message is e2e encrypted or not:
Goffi <goffi@goffi.org>
parents:
448
diff
changeset
|
146 symbol: 'lock-filled' if root.mess_data.encrypted else 'lock-open' |
6c21a5a44b54
chat: show a padlock icon to indicate if message is e2e encrypted or not:
Goffi <goffi@goffi.org>
parents:
448
diff
changeset
|
147 font_size: self.height - dp(3) |
6c21a5a44b54
chat: show a padlock icon to indicate if message is e2e encrypted or not:
Goffi <goffi@goffi.org>
parents:
448
diff
changeset
|
148 color: (1, 0, 0, 1) if not root.mess_data.encrypted and root.chat.encrypted else (0.55,0.55,0.55,1) |
138 | 149 Label: |
150 id: delivery | |
274 | 151 color: C.COLOR_BTN_LIGHT |
185
ab3f5173ef5c
chat, simple XHTML: font size adjustement
Goffi <goffi@goffi.org>
parents:
167
diff
changeset
|
152 font_size: root.font_size |
138 | 153 text_size: None, None |
154 size_hint: None, None | |
155 size: self.texture_size | |
156 padding: dp(5), 0 | |
157 # XXX: DejaVuSans font is needed as check mark is not in Roboto | |
158 # this can be removed when Kivy will be able to handle fallback mechanism | |
159 # which will allow us to use fonts with more unicode characters | |
160 font_name: "DejaVuSans" | |
161 text: u'' | |
57 | 162 SimpleXHTMLWidget: |
163 id: mess_xhtml | |
138 | 164 size_hint: 1, None |
58
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
165 height: self.minimum_height |
441
ff548846df91
chat: use `image-loading` as source by default:
Goffi <goffi@goffi.org>
parents:
437
diff
changeset
|
166 xhtml: root.message_xhtml or self.escape(root.message or '') |
325 | 167 color: (0.74,0.74,0.24,1) if root.mess_type == "info" else (0, 0, 0, 1) |
45 | 168 padding: root.mess_padding |
325 | 169 bold: True if root.mess_type == "info" else False |
170 | |
45 | 171 |
412 | 172 <AttachmentToSendItem>: |
173 SymbolButton: | |
174 opacity: 0 if root.sending else 1 | |
175 size_hint: None, 1 | |
176 symbol: "cancel-circled" | |
177 on_press: root.parent.remove_widget(root) | |
178 | |
179 | |
180 <AttachmentsToSend>: | |
181 attachments: attachments_layout.attachments | |
448
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
182 reduce_checkbox: reduce_checkbox |
412 | 183 orientation: "vertical" |
184 size_hint: 1, None | |
185 height: self.minimum_height if self.attachments.children else 0 | |
186 opacity: 1 if self.attachments.children else 0 | |
187 padding: [app.MARGIN_LEFT, dp(5), app.MARGIN_RIGHT, dp(5)] | |
448
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
188 canvas.before: |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
189 Color: |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
190 rgba: app.c_prim |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
191 Rectangle: |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
192 pos: self.pos |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
193 size: self.size |
412 | 194 Label: |
195 size_hint: 1, None | |
196 size: self.texture_size | |
197 text: _("attachments:") | |
198 bold: True | |
199 AttachmentsLayout: | |
200 id: attachments_layout | |
448
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
201 BoxLayout: |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
202 id: resize_box |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
203 size_hint: 1, None |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
204 opacity: 1 if root.show_resize else 0 |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
205 height: dp(25) if root.show_resize else 0 |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
206 Widget: |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
207 CheckBox: |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
208 id: reduce_checkbox |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
209 size_hint: None, 1 |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
210 width: dp(20) |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
211 active: True |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
212 Label: |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
213 size_hint: None, 1 |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
214 text: _("reduce images size") |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
215 text_size: None, None |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
216 size: self.texture_size |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
217 valign: "middle" |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
218 padding_x: dp(10) |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
219 font_size: sp(15) |
20a807443c3f
chat: resize attachments (images only for now):
Goffi <goffi@goffi.org>
parents:
447
diff
changeset
|
220 Widget: |
412 | 221 |
86 | 222 <Chat>: |
412 | 223 attachments_to_send: attachments_to_send |
325 | 224 message_input: message_input |
86 | 225 messages_widget: messages_widget |
326 | 226 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
|
227 send_button_visible: G.local_platform.send_button_visible or bool(attachments_to_send.attachments.children) |
86 | 228 ScrollView: |
326 | 229 id: history_scroll |
86 | 230 scroll_y: 0 |
491
203755bbe0fe
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
461
diff
changeset
|
231 on_scroll_y: root.on_scroll(*args) |
86 | 232 do_scroll_x: False |
167
ffef21fd97a2
chat: allow to scroll using side bar + increased bar size
Goffi <goffi@goffi.org>
parents:
153
diff
changeset
|
233 scroll_type: ['bars', 'content'] |
326 | 234 bar_width: dp(10) |
235 effect_cls: ScrollEffect | |
325 | 236 DelayedBoxLayout: |
86 | 237 id: messages_widget |
325 | 238 size_hint_y: None |
239 padding: [app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, dp(10)] | |
240 spacing: dp(10) | |
241 height: self.minimum_height | |
242 orientation: 'vertical' | |
412 | 243 AttachmentsToSend: |
244 id: attachments_to_send | |
86 | 245 MessageInputBox: |
78 | 246 size_hint: 1, None |
276 | 247 height: self.minimum_height |
252
fdda914a298b
chat: added some padding in MessageInputBox
Goffi <goffi@goffi.org>
parents:
244
diff
changeset
|
248 spacing: dp(10) |
274 | 249 padding: [app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, dp(10)] |
86 | 250 message_input: message_input |
251 MessageInputWidget: | |
252 id: message_input | |
276 | 253 size_hint: 1, None |
254 height: min(self.minimum_height, dp(250)) | |
255 multiline: True | |
104
663e44f30092
chat: added gettext call for hint_text in input
Goffi <goffi@goffi.org>
parents:
103
diff
changeset
|
256 hint_text: _(u"Enter your message here") |
491
203755bbe0fe
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
461
diff
changeset
|
257 on_text_validate: root.on_send(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
|
258 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
|
259 # "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
|
260 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
|
261 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
|
262 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
|
263 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
|
264 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
|
265 on_release: self.parent.send_text() |
276 | 266 |
267 | |
278
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
268 # Buttons added in header |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
269 |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
270 <TransferButton>: |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
271 size_hint: None, 1 |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
272 symbol: "plus-circled" |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
273 width: dp(30) |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
274 font_size: dp(25) |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
275 color: 0.4, 0.4, 0.4, 1 |
444ba439530f
chat: moved transfer button to header_box
Goffi <goffi@goffi.org>
parents:
276
diff
changeset
|
276 |
287
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
277 <MenuButton@Button> |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
278 size_hint_y: None |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
279 height: dp(30) |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
280 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
|
281 |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
282 <ExtraMenu>: |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
283 auto_width: False |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
284 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
|
285 text: _("bookmarks") |
287
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
286 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
|
287 MenuButton: |
e2f806779b53
chat: added a "close" item in menu, to leave MUC/close current chat widget.
Goffi <goffi@goffi.org>
parents:
367
diff
changeset
|
288 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
|
289 on_release: root.select("close") |
287
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
290 |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
291 <ExtraButton>: |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
292 size_hint: None, 1 |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
293 symbol: "dot-3-vert" |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
294 width: dp(30) |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
295 font_size: dp(25) |
5d96bcd3bfec
chat: added an extra menu (3 dots menu):
Goffi <goffi@goffi.org>
parents:
282
diff
changeset
|
296 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
|
297 on_release: self.chat.extra_menu.open(self) |
276 | 298 |
233
ba8f3a4a5ac7
plugin chat: e2e encryption improvments:
Goffi <goffi@goffi.org>
parents:
185
diff
changeset
|
299 <EncryptionMainButton>: |
117 | 300 size_hint: None, 1 |
301 width: dp(30) | |
491
203755bbe0fe
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
461
diff
changeset
|
302 color: self.get_color() |
203755bbe0fe
massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents:
461
diff
changeset
|
303 symbol: self.get_symbol() |
117 | 304 |
242
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
305 <TrustManagementButton>: |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
306 symbol: "shield" |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
307 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
|
308 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
|
309 size_hint: None, 1 |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
310 width: dp(30) |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
311 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
|
312 |
233
ba8f3a4a5ac7
plugin chat: e2e encryption improvments:
Goffi <goffi@goffi.org>
parents:
185
diff
changeset
|
313 <EncryptionButton>: |
117 | 314 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
|
315 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
|
316 height: dp(30) |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
317 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
|
318 Button: |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
319 text: root.text |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
320 size_hint: 1, 1 |
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
321 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
|
322 color: 0, 0, 0, 1 |
312 | 323 bold: root.bold |
242
c2503168fab7
plugin chat (encryption): added a button to display trust management UI.
Goffi <goffi@goffi.org>
parents:
233
diff
changeset
|
324 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
|
325 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
|
326 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
|
327 on_texture_size: root.best_width = self.texture_size[0] + (dp(30) if root.trust_button else 0) |
117 | 328 |
233
ba8f3a4a5ac7
plugin chat: e2e encryption improvments:
Goffi <goffi@goffi.org>
parents:
185
diff
changeset
|
329 <EncryptionMenu>: |
117 | 330 size_hint_x: None |
233
ba8f3a4a5ac7
plugin chat: e2e encryption improvments:
Goffi <goffi@goffi.org>
parents:
185
diff
changeset
|
331 width: self.container.minimum_width |
117 | 332 auto_width: False |
333 canvas.before: | |
334 Color: | |
335 rgba: 0, 0, 0, 1 | |
336 Rectangle: | |
337 pos: self.pos | |
338 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
|
339 |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
340 |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
341 # 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
|
342 |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
343 <ChatSelector>: |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
344 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
|
345 JidSelector: |
d15828ca9d86
chat: use the new "implicit_update" and "to_show" properties for ChatSelector.jid_selector:
Goffi <goffi@goffi.org>
parents:
393
diff
changeset
|
346 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
|
347 on_select: root.on_select(args[1]) |
404
f7476818f9fb
core (common): JidSelector + behaviors various improvments:
Goffi <goffi@goffi.org>
parents:
394
diff
changeset
|
348 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
|
349 |