comparison 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
comparison
equal deleted inserted replaced
408:355326a3501c 409:2caea63ae2ab
22 #:import ScrollEffect kivy.effects.scroll.ScrollEffect 22 #:import ScrollEffect kivy.effects.scroll.ScrollEffect
23 #:import CategorySeparator cagou.core.common_widgets.CategorySeparator 23 #:import CategorySeparator cagou.core.common_widgets.CategorySeparator
24 24
25 25
26 # Chat 26 # Chat
27
28
29 <AttachmentItem>:
30 size_hint: None, 1
31 width: dp(100)
32 SymbolLabel:
33 symbol: root.get_symbol(root.data)
34 text: root.data.get('name', '')
35 bold: False
36 on_press: root.on_press()
37
38
39 <AttachmentsLayout>:
40 attachments: attachments
41 size_hint: 1, None
42 height: dp(50)
43 BoxLayout:
44 id: attachments
45 size_hint: None, 1
46 width: self.minimum_width
47
27 48
28 <MessAvatar>: 49 <MessAvatar>:
29 size_hint: None, None 50 size_hint: None, None
30 size: dp(30), dp(30) 51 size: dp(30), dp(30)
31 canvas.before: 52 canvas.before:
58 size_hint: 1, 1 79 size_hint: 1, 1
59 BoxLayout: 80 BoxLayout:
60 size_hint: 1, None 81 size_hint: 1, None
61 orientation: 'vertical' 82 orientation: 'vertical'
62 id: right_part 83 id: right_part
63 height: header_box.height + mess_xhtml.height 84 height: self.minimum_height
64 BoxLayout: 85 BoxLayout:
65 id: header_box 86 id: header_box
66 size_hint: 1, None 87 size_hint: 1, None
67 height: time_label.height if root.mess_type != C.MESS_TYPE_INFO else 0 88 height: time_label.height if root.mess_type != C.MESS_TYPE_INFO else 0
68 opacity: 1 if root.mess_type != C.MESS_TYPE_INFO else 0 89 opacity: 1 if root.mess_type != C.MESS_TYPE_INFO else 0
92 text: u'' 113 text: u''
93 SimpleXHTMLWidget: 114 SimpleXHTMLWidget:
94 id: mess_xhtml 115 id: mess_xhtml
95 size_hint: 1, None 116 size_hint: 1, None
96 height: self.minimum_height 117 height: self.minimum_height
97 xhtml: root.message_xhtml or self.escape(root.message or u' ') 118 xhtml: root.message_xhtml or self.escape(root.message or u'')
98 color: (0.74,0.74,0.24,1) if root.mess_type == "info" else (0, 0, 0, 1) 119 color: (0.74,0.74,0.24,1) if root.mess_type == "info" else (0, 0, 0, 1)
99 padding: root.mess_padding 120 padding: root.mess_padding
100 bold: True if root.mess_type == "info" else False 121 bold: True if root.mess_type == "info" else False
101 122
102 123