Mercurial > libervia-desktop-kivy
annotate src/cagou/plugins/plugin_wid_chat.kv @ 23:f9869f34f629
chat: time text is now displayed above text bubble
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 08 Aug 2016 21:05:29 +0200 |
parents | 74117b733bac |
children | bc15b55a4114 |
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 | |
17 <MessagesWidget>: | |
18 spacing: self._spacing | |
19 padding: self._padding | |
20 | |
21 <MessageInputWidget>: | |
22 size_hint: 1,None | |
23 height: 40 | |
24 hint_text: "Enter your message here" | |
25 | |
26 <MessageWidget>: | |
27 | |
28 mess_label: mess_label | |
29 size_hint: None,None | |
30 pos_hint: {'x': 0} if root.mess_data.own_mess else {'right': 1} | |
23
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
31 height: mess_label.height + time_label.height |
22 | 32 width: mess_label.width |
33 on_height: if root.parent: root.parent.sizeAdjust() | |
23
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
34 Label: |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
35 id: time_label |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
36 size_hint: None, None |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
37 height: self.texture_size[1] |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
38 width: root.parent.width if root.parent else 100 |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
39 text: root.mess_data.time_text |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
40 halign: "center" |
22 | 41 BoxLayout: |
23
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
42 canvas.before: |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
43 Color: |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
44 rgba: 1, 1, 1, 1 |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
45 BorderImage: |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
46 source: "cagou/images/border_{}.jpg".format("blue" if root.mess_data.own_mess else "gray") |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
47 pos: self.pos |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
48 size: self.size |
f9869f34f629
chat: time text is now displayed above text bubble
Goffi <goffi@goffi.org>
parents:
22
diff
changeset
|
49 |
22 | 50 # Label: |
51 # id: nick_label | |
52 # text: root.mess_data.nick | |
53 # # text: unicode(self.texture_size) | |
54 # padding: 5, 5 | |
55 # bold: True | |
56 # # text_size: None, self.height | |
57 # # height: 20 | |
58 # size_hint: None, None | |
59 # size: self.texture_size | |
60 # pos_hint: {'top': 0} | |
61 # # width: self.texture_size[0] | |
62 # # height: max(self.texture_size[1], mess_label.height) | |
63 # # size_hint: None, 1 | |
64 # # valign: "top" | |
65 Label: | |
66 id: mess_label | |
67 color: 0, 0, 0, 1 | |
68 padding: 5, 5 | |
69 text_size: None, None | |
70 size_hint: None, None | |
71 size: self.texture_size | |
72 # text: 'root:{} nick:{} self:{}'.format(root.height, nick_label.height, self.height) | |
73 text: root.message or u' ' | |
74 # haligh: "left" | |
75 on_texture_size: root.adjustMax(self.texture_size) |