comparison cagou/plugins/plugin_wid_chat.py @ 441:ff548846df91

chat: use `image-loading` as source by default: not specifying source was resulting in graphical glitches (notably when the image could not be downloaded correctly). Using `image-loading` as default avoids this, and indicates to the user that something is running in background.
author Goffi <goffi@goffi.org>
date Sat, 07 Mar 2020 00:05:50 +0100
parents b5e6d36fbf9c
children c2b63d3bb088
comparison
equal deleted inserted replaced
440:167c3e198f73 441:ff548846df91
173 to_download = False 173 to_download = False
174 174
175 if idx < 3 or len(attachments) <= 4: 175 if idx < 3 or len(attachments) <= 4:
176 if ((self.mess_data.own_mess 176 if ((self.mess_data.own_mess
177 or self.chat.contact_list.isInRoster(self.mess_data.from_jid))): 177 or self.chat.contact_list.isInRoster(self.mess_data.from_jid))):
178 wid = AsyncImage(size_hint=(1, 1)) 178 wid = AsyncImage(size_hint=(1, 1), source="data/images/image-loading.gif")
179 if 'preview' in attachment: 179 if 'preview' in attachment:
180 wid.source = attachment["preview"] 180 wid.source = attachment["preview"]
181 elif 'path' in attachment: 181 elif 'path' in attachment:
182 G.host.bridge.imageGeneratePreview( 182 G.host.bridge.imageGeneratePreview(
183 attachment['path'], 183 attachment['path'],