comparison 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
comparison
equal deleted inserted replaced
22:74117b733bac 23:f9869f34f629
22 size_hint: 1,None 22 size_hint: 1,None
23 height: 40 23 height: 40
24 hint_text: "Enter your message here" 24 hint_text: "Enter your message here"
25 25
26 <MessageWidget>: 26 <MessageWidget>:
27 canvas.before:
28 Color:
29 rgba: 1, 1, 1, 1
30 BorderImage:
31 source: "cagou/images/border_{}.jpg".format("blue" if root.mess_data.own_mess else "gray")
32 pos: self.pos
33 size: self.size
34 27
35 mess_label: mess_label 28 mess_label: mess_label
36 size_hint: None,None 29 size_hint: None,None
37 pos_hint: {'x': 0} if root.mess_data.own_mess else {'right': 1} 30 pos_hint: {'x': 0} if root.mess_data.own_mess else {'right': 1}
38 height: max(mess_label.height, 20) 31 height: mess_label.height + time_label.height
39 width: mess_label.width 32 width: mess_label.width
40 on_height: if root.parent: root.parent.sizeAdjust() 33 on_height: if root.parent: root.parent.sizeAdjust()
34 Label:
35 id: time_label
36 size_hint: None, None
37 height: self.texture_size[1]
38 width: root.parent.width if root.parent else 100
39 text: root.mess_data.time_text
40 halign: "center"
41 BoxLayout: 41 BoxLayout:
42 canvas.before:
43 Color:
44 rgba: 1, 1, 1, 1
45 BorderImage:
46 source: "cagou/images/border_{}.jpg".format("blue" if root.mess_data.own_mess else "gray")
47 pos: self.pos
48 size: self.size
49
42 # Label: 50 # Label:
43 # id: nick_label 51 # id: nick_label
44 # text: root.mess_data.nick 52 # text: root.mess_data.nick
45 # # text: unicode(self.texture_size) 53 # # text: unicode(self.texture_size)
46 # padding: 5, 5 54 # padding: 5, 5