changeset 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
files src/cagou/plugins/plugin_wid_chat.kv
diffstat 1 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/cagou/plugins/plugin_wid_chat.kv	Mon Aug 08 01:07:43 2016 +0200
+++ b/src/cagou/plugins/plugin_wid_chat.kv	Mon Aug 08 21:05:29 2016 +0200
@@ -24,21 +24,29 @@
     hint_text: "Enter your message here"
 
 <MessageWidget>:
-    canvas.before:
-        Color:
-            rgba: 1, 1, 1, 1
-        BorderImage:
-            source: "cagou/images/border_{}.jpg".format("blue" if root.mess_data.own_mess else "gray")
-            pos: self.pos
-            size: self.size
 
     mess_label: mess_label
     size_hint: None,None
     pos_hint: {'x': 0} if root.mess_data.own_mess else {'right': 1}
-    height: max(mess_label.height, 20)
+    height: mess_label.height + time_label.height
     width: mess_label.width
     on_height: if root.parent: root.parent.sizeAdjust()
+    Label:
+        id: time_label
+        size_hint: None, None
+        height: self.texture_size[1]
+        width: root.parent.width if root.parent else 100
+        text: root.mess_data.time_text
+        halign: "center"
     BoxLayout:
+        canvas.before:
+            Color:
+                rgba: 1, 1, 1, 1
+            BorderImage:
+                source: "cagou/images/border_{}.jpg".format("blue" if root.mess_data.own_mess else "gray")
+                pos: self.pos
+                size: self.size
+
         # Label:
         #     id: nick_label
         #     text: root.mess_data.nick