Mercurial > libervia-desktop-kivy
annotate src/cagou/plugins/plugin_wid_chat.kv @ 95:3e3c097b07b7
upload: added voice plugin (for Android)
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 27 Dec 2016 21:54:09 +0100 |
parents | c711be670ecd |
children | 5d2289127bb7 |
rev | line source |
---|---|
22 | 1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client |
2 # Copyright (C) 2016 Jérôme Poisson (goffi@goffi.org) | |
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 | |
44
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
17 |
58
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
18 <SimpleXHTMLWidgetEscapedText>: |
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
19 size_hint: None, None |
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
20 size: self.texture_size |
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
21 |
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
22 <SimpleXHTMLWidgetText>: |
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
23 size_hint: None, None |
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
24 size: self.texture_size |
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
25 |
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
26 <SimpleXHTMLWidgetImage>: |
59 | 27 size_hint: None, None |
58
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
28 |
44
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
29 <MessAvatar>: |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
30 size_hint: None, None |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
31 size: dp(30), dp(30) |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
32 |
22 | 33 <MessagesWidget>: |
45 | 34 cols: 1 |
35 padding: dp(10) | |
36 spacing: dp(5) | |
37 size_hint: 1, None | |
38 height: self.minimum_height | |
22 | 39 |
40 <MessageWidget>: | |
45 | 41 cols: 1 |
57 | 42 mess_xhtml: mess_xhtml |
45 | 43 padding: dp(10) |
44 spacing: dp(5) | |
24
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
45 size_hint: 1, None |
45 | 46 height: self.minimum_height |
47 on_width: self.widthAdjust() | |
47
abb81efef3bb
chat: update avatar following quick frontend improvments
Goffi <goffi@goffi.org>
parents:
45
diff
changeset
|
48 avatar: avatar |
45 | 49 BoxLayout: |
50 id: header_box | |
51 size_hint: 1, None | |
52 height: avatar.height | |
53 MessAvatar: | |
54 id: avatar | |
55 source: root.mess_data.avatar | |
44
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
56 Label: |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
57 id: time_label |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
58 text_size: None, None |
45 | 59 size_hint: None, None |
60 size: self.texture_size | |
61 padding: dp(5), 0 | |
62 text: u"{}, {}".format(root.mess_data.nick, root.mess_data.time_text) | |
22 | 63 BoxLayout: |
45 | 64 # BoxLayout is needed here, else GridLayout won't let the Label choose its width |
65 size_hint: 1, None | |
57 | 66 height: mess_xhtml.height |
45 | 67 on_size: root.widthAdjust() |
57 | 68 SimpleXHTMLWidget: |
24
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
69 canvas.before: |
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
70 Color: |
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
71 rgba: 1, 1, 1, 1 |
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
72 BorderImage: |
45 | 73 source: app.expand("{media}/misc/black.png") if root.mess_data.type == "info" else app.expand("{media}/misc/borders/{}.jpg", "blue" if root.mess_data.own_mess else "gray") |
24
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
74 pos: self.pos |
58
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
75 size: self.content_width, self.height |
57 | 76 id: mess_xhtml |
58
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
77 size_hint: 0.8, None |
7aa2ffff9067
chat: <img/> tag handling first draft:
Goffi <goffi@goffi.org>
parents:
57
diff
changeset
|
78 height: self.minimum_height |
57 | 79 xhtml: root.message_xhtml or self.escape(root.message or u' ') |
45 | 80 color: (0.74,0.74,0.24,1) if root.mess_data.type == "info" else (0, 0, 0, 1) |
81 padding: root.mess_padding | |
82 bold: True if root.mess_data.type == "info" else False | |
83 | |
78 | 84 |
86 | 85 <Chat>: |
86 messages_widget: messages_widget | |
87 ScrollView: | |
88 size_hint: 1, 0.8 | |
89 scroll_y: 0 | |
90 do_scroll_x: False | |
91 MessagesWidget: | |
92 id: messages_widget | |
93 MessageInputBox: | |
78 | 94 size_hint: 1, None |
86 | 95 height: dp(40) |
96 message_input: message_input | |
97 MessageInputWidget: | |
98 id: message_input | |
99 size_hint: 1, 1 | |
100 hint_text: "Enter your message here" | |
101 on_text_validate: root.onSend(args[0]) | |
102 IconButton | |
103 # upload button | |
104 source: app.expand("{media}/icons/tango/actions/32/list-add.png") | |
105 allow_stretch: True | |
106 size_hint: None, 1 | |
107 width: max(self.texture_size[0], dp(40)) | |
108 on_release: upload_menu.show(self) | |
109 UploadMenu: | |
110 id: upload_menu | |
111 callback: root.onUploadOK |