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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
1 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # Copyright (C) 2016 Jérôme Poisson (goffi@goffi.org)
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
3
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This program is free software: you can redistribute it and/or modify
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # it under the terms of the GNU Affero General Public License as published by
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # the Free Software Foundation, either version 3 of the License, or
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # (at your option) any later version.
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
8
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # This program is distributed in the hope that it will be useful,
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # GNU Affero General Public License for more details.
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
13
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # You should have received a copy of the GNU Affero General Public License
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
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
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
22 <MessagesWidget>:
45
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
23 cols: 1
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
24 padding: dp(10)
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
25 spacing: dp(5)
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
26 size_hint: 1, None
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
27 height: self.minimum_height
22
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
28
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
29 <MessageWidget>:
45
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
30 cols: 1
22
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
31 mess_label: mess_label
45
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
32 padding: dp(10)
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
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
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
35 height: self.minimum_height
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
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
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
38 BoxLayout:
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
39 id: header_box
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
40 size_hint: 1, None
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
41 height: avatar.height
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
42 MessAvatar:
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
43 id: avatar
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
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
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
48 size_hint: None, None
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
49 size: self.texture_size
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
50 padding: dp(5), 0
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
51 text: u"{}, {}".format(root.mess_data.nick, root.mess_data.time_text)
22
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
52 BoxLayout:
45
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
53 # BoxLayout is needed here, else GridLayout won't let the Label choose its width
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
54 size_hint: 1, None
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
55 height: mess_label.height
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
56 on_size: root.widthAdjust()
22
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
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
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
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
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
65 id: mess_label
45
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
66 color: (0.74,0.74,0.24,1) if root.mess_data.type == "info" else (0, 0, 0, 1)
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
67 padding: root.mess_padding
22
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
68 text_size: None, None
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
69 size_hint: None, None
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
70 size: self.texture_size
45
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
71 bold: True if root.mess_data.type == "info" else False
22
74117b733bac plugin chat: first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
72 text: root.message or u' '
45
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
73 # on_texture_size: root.widthAdjust()
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
74
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
75
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
76 <MessageInputWidget>:
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
77 size_hint: 1, None
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
78 height: dp(40)
b0595a33465d chat: design improvments:
Goffi <goffi@goffi.org>
parents: 44
diff changeset
79 hint_text: "Enter your message here"