comparison src/cagou/plugins/plugin_wid_chat.kv @ 44:7819e9efa250

chat: avatar and nick are now displayed, need further aesthetic improvments
author Goffi <goffi@goffi.org>
date Mon, 29 Aug 2016 01:23:49 +0200
parents 4f9e701d76b4
children b0595a33465d
comparison
equal deleted inserted replaced
43:12fdc7d1feb1 44:7819e9efa250
12 # GNU Affero General Public License for more details. 12 # GNU Affero General Public License for more details.
13 13
14 # You should have received a copy of the GNU Affero General Public License 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/>. 15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 16
17
18 <MessAvatar>:
19 size_hint: None, None
20 size: dp(30), dp(30)
21
17 <MessagesWidget>: 22 <MessagesWidget>:
18 spacing: self._spacing 23 spacing: self._spacing
19 padding: self._padding 24 padding: self._padding
20 25
21 <MessageInputWidget>: 26 <MessageInputWidget>:
23 height: 40 28 height: 40
24 hint_text: "Enter your message here" 29 hint_text: "Enter your message here"
25 30
26 <MessageWidget>: 31 <MessageWidget>:
27 mess_label: mess_label 32 mess_label: mess_label
33 mess_box: mess_box
28 size_hint: 1, None 34 size_hint: 1, None
29 height: time_label.height + mess_label.height 35 height: time_label.height + mess_label.height
30 on_height: if root.parent: root.parent.sizeAdjust() 36 on_height: if root.parent: root.parent.sizeAdjust()
31 on_width: self.sizeAdjust() 37 on_width: self.sizeAdjust()
32 Label: 38 FloatLayout:
33 id: time_label 39 Label:
34 text_size: None, None 40 id: time_label
35 size_hint: 1, None 41 text_size: None, None
36 height: self.texture_size[1] 42 size_hint: 1, None
37 text: root.mess_data.time_text 43 height: self.texture_size[1]
38 halign: "center" 44 pos_hint: {'x':0, 'y':0}
45 text: root.mess_data.time_text
46 halign: "center"
47 Label:
48 size_hint: 1, 1
49 text_size: self.size
50 pos_hint: {'x':0, 'y':0}
51 text: root.mess_data.nick
52 halign: "left" if root.mess_data.own_mess else "right"
39 BoxLayout: 53 BoxLayout:
54 id: mess_box
40 size_hint: None,None 55 size_hint: None,None
41 size: mess_label.size 56 size: sum([c.width for c in self.children]), mess_label.height
42 pos_hint: {'x': 0} if root.mess_data.own_mess else {'right': 1} 57 pos_hint: {'x': 0} if root.mess_data.own_mess else {'right': 1}
43
44 # Label:
45 # id: nick_label
46 # text: root.mess_data.nick
47 # # text: unicode(self.texture_size)
48 # padding: 5, 5
49 # bold: True
50 # # text_size: None, self.height
51 # # height: 20
52 # size_hint: None, None
53 # size: self.texture_size
54 # pos_hint: {'top': 0}
55 # # width: self.texture_size[0]
56 # # height: max(self.texture_size[1], mess_label.height)
57 # # size_hint: None, 1
58 # # valign: "top"
59 Label: 58 Label:
60 canvas.before: 59 canvas.before:
61 Color: 60 Color:
62 rgba: 1, 1, 1, 1 61 rgba: 1, 1, 1, 1
63 BorderImage: 62 BorderImage: