diff cagou/plugins/plugin_wid_chat.kv @ 409:2caea63ae2ab

chat: show attachments as clickable icons
author Goffi <goffi@goffi.org>
date Wed, 19 Feb 2020 09:49:21 +0100
parents 03554ad70846
children b018386653c2
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_chat.kv	Wed Feb 19 09:49:20 2020 +0100
+++ b/cagou/plugins/plugin_wid_chat.kv	Wed Feb 19 09:49:21 2020 +0100
@@ -25,6 +25,27 @@
 
 # Chat
 
+
+<AttachmentItem>:
+    size_hint: None, 1
+    width: dp(100)
+    SymbolLabel:
+        symbol: root.get_symbol(root.data)
+        text: root.data.get('name', '')
+        bold: False
+        on_press: root.on_press()
+
+
+<AttachmentsLayout>:
+    attachments: attachments
+    size_hint: 1, None
+    height: dp(50)
+    BoxLayout:
+        id: attachments
+        size_hint: None, 1
+        width: self.minimum_width
+
+
 <MessAvatar>:
     size_hint: None, None
     size: dp(30), dp(30)
@@ -60,7 +81,7 @@
         size_hint: 1, None
         orientation: 'vertical'
         id: right_part
-        height: header_box.height + mess_xhtml.height
+        height: self.minimum_height
         BoxLayout:
             id: header_box
             size_hint: 1, None
@@ -94,7 +115,7 @@
             id: mess_xhtml
             size_hint: 1, None
             height: self.minimum_height
-            xhtml: root.message_xhtml or self.escape(root.message or u' ')
+            xhtml: root.message_xhtml or self.escape(root.message or u'')
             color: (0.74,0.74,0.24,1) if root.mess_type == "info" else (0, 0, 0, 1)
             padding: root.mess_padding
             bold: True if root.mess_type == "info" else False