changeset 411:b018386653c2

chat: work around ScrollView bug in attachments by using a StackLayout instead: cf. https://github.com/kivy/kivy/issues/6745
author Goffi <goffi@goffi.org>
date Sat, 22 Feb 2020 18:34:09 +0100
parents 2a58f3d756ad
children 7c6149c249c1
files cagou/plugins/plugin_wid_chat.kv cagou/plugins/plugin_wid_chat.py
diffstat 2 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_chat.kv	Sat Feb 22 18:28:47 2020 +0100
+++ b/cagou/plugins/plugin_wid_chat.kv	Sat Feb 22 18:34:09 2020 +0100
@@ -27,8 +27,8 @@
 
 
 <AttachmentItem>:
-    size_hint: None, 1
-    width: dp(100)
+    size_hint: None, None
+    size: self.minimum_width, dp(50)
     SymbolLabel:
         symbol: root.get_symbol(root.data)
         text: root.data.get('name', '')
@@ -37,13 +37,9 @@
 
 
 <AttachmentsLayout>:
-    attachments: attachments
+    attachments: self
     size_hint: 1, None
-    height: dp(50)
-    BoxLayout:
-        id: attachments
-        size_hint: None, 1
-        width: self.minimum_width
+    height: self.minimum_height
 
 
 <MessAvatar>:
--- a/cagou/plugins/plugin_wid_chat.py	Sat Feb 22 18:28:47 2020 +0100
+++ b/cagou/plugins/plugin_wid_chat.py	Sat Feb 22 18:34:09 2020 +0100
@@ -28,7 +28,7 @@
 from kivy.metrics import sp, dp
 from kivy.clock import Clock
 from kivy import properties
-from kivy.uix.scrollview import ScrollView
+from kivy.uix.stacklayout import StackLayout
 from kivy.uix.dropdown import DropDown
 from kivy.core.window import Window
 from sat.core import log as logging
@@ -77,7 +77,9 @@
 INFINITE_SCROLL_LIMIT = dp(600)
 
 
-class AttachmentsLayout(ScrollView):
+# FIXME: a ScrollLayout was supposed to be used here, but due
+#   to https://github.com/kivy/kivy/issues/6745, a StackLayout is used for now
+class AttachmentsLayout(StackLayout):
     attachments = properties.ObjectProperty()