Mercurial > libervia-desktop-kivy
annotate src/cagou/plugins/plugin_wid_chat.kv @ 47:abb81efef3bb
chat: update avatar following quick frontend improvments
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 10 Sep 2016 00:05:46 +0200 |
parents | b0595a33465d |
children | a51ea7874e43 |
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 |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
18 <MessAvatar>: |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
19 size_hint: None, None |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
20 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
|
21 |
22 | 22 <MessagesWidget>: |
45 | 23 cols: 1 |
24 padding: dp(10) | |
25 spacing: dp(5) | |
26 size_hint: 1, None | |
27 height: self.minimum_height | |
22 | 28 |
29 <MessageWidget>: | |
45 | 30 cols: 1 |
22 | 31 mess_label: mess_label |
45 | 32 padding: dp(10) |
33 spacing: dp(5) | |
24
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
34 size_hint: 1, None |
45 | 35 height: self.minimum_height |
36 on_width: self.widthAdjust() | |
47
abb81efef3bb
chat: update avatar following quick frontend improvments
Goffi <goffi@goffi.org>
parents:
45
diff
changeset
|
37 avatar: avatar |
45 | 38 BoxLayout: |
39 id: header_box | |
40 size_hint: 1, None | |
41 height: avatar.height | |
42 MessAvatar: | |
43 id: avatar | |
44 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
|
45 Label: |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
46 id: time_label |
7819e9efa250
chat: avatar and nick are now displayed, need further aesthetic improvments
Goffi <goffi@goffi.org>
parents:
31
diff
changeset
|
47 text_size: None, None |
45 | 48 size_hint: None, None |
49 size: self.texture_size | |
50 padding: dp(5), 0 | |
51 text: u"{}, {}".format(root.mess_data.nick, root.mess_data.time_text) | |
22 | 52 BoxLayout: |
45 | 53 # BoxLayout is needed here, else GridLayout won't let the Label choose its width |
54 size_hint: 1, None | |
55 height: mess_label.height | |
56 on_size: root.widthAdjust() | |
22 | 57 Label: |
24
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
58 canvas.before: |
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
59 Color: |
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
60 rgba: 1, 1, 1, 1 |
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
61 BorderImage: |
45 | 62 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
|
63 pos: self.pos |
bc15b55a4114
chat: better bubble and time resizing
Goffi <goffi@goffi.org>
parents:
23
diff
changeset
|
64 size: self.size |
22 | 65 id: mess_label |
45 | 66 color: (0.74,0.74,0.24,1) if root.mess_data.type == "info" else (0, 0, 0, 1) |
67 padding: root.mess_padding | |
22 | 68 text_size: None, None |
69 size_hint: None, None | |
70 size: self.texture_size | |
45 | 71 bold: True if root.mess_data.type == "info" else False |
22 | 72 text: root.message or u' ' |
45 | 73 # on_texture_size: root.widthAdjust() |
74 | |
75 | |
76 <MessageInputWidget>: | |
77 size_hint: 1, None | |
78 height: dp(40) | |
79 hint_text: "Enter your message here" |