comparison cagou/plugins/plugin_wid_chat.kv @ 425:13884aac1220

chat: show images in attachments: - if an image is received from somebody in roster, it is automatically displayed (we display only for people in roster to avoid IP address leak) - encrypted files are decrypted and stored in cache before being displayed - GIFs image are shown as attachment because they are badly handle in Kivy (images frequencies is not handled correctly, and memory consumption explode). Instead, a click on it will open the GIF in the appropriate software of the platform. - a click on an attachment image will open it in the gallery
author Goffi <goffi@goffi.org>
date Wed, 26 Feb 2020 16:47:39 +0100
parents 3e2333a11f61
children d3a6ae859556
comparison
equal deleted inserted replaced
424:027fad764864 425:13884aac1220
25 25
26 26
27 # Chat 27 # Chat
28 28
29 29
30 <AttachmentItem>: 30 <BaseAttachmentItem>:
31 size_hint: None, None 31 size_hint: None, None
32 size: self.minimum_width, dp(50) 32 size: self.minimum_width, dp(50)
33
34
35 <AttachmentItem>:
33 canvas.before: 36 canvas.before:
34 Color: 37 Color:
35 rgb: app.c_prim_dark 38 rgb: app.c_prim_dark
36 RoundedRectangle: 39 RoundedRectangle:
37 pos: self.pos 40 pos: self.pos
50 symbol: root.get_symbol(root.data) 53 symbol: root.get_symbol(root.data)
51 color: 0, 0, 0, 1 54 color: 0, 0, 0, 1
52 text: root.data.get('name', _('unnamed')) 55 text: root.data.get('name', _('unnamed'))
53 bold: False 56 bold: False
54 on_press: root.on_press() 57 on_press: root.on_press()
58
59
60 <AttachmentImageItem>:
61 size: self.minimum_width, self.minimum_height
62 image: image
63 orientation: "vertical"
64 SizedImage:
65 id: image
66 source: root.data.get('url', root.data.get('path'))
67 anim_delay: -1
55 68
56 69
57 <AttachmentsLayout>: 70 <AttachmentsLayout>:
58 attachments: self 71 attachments: self
59 size_hint: 1, None 72 size_hint: 1, None