diff cagou/plugins/plugin_wid_widget_selector.py @ 365:9c6fe392d623

core (widgets_handler): use a StencilView + BoxLayout instead of ScrollView as wrapper: The default wrapping when no Carousel or ScreenManager was used was a ScrollView. This was causing bugs as the touch event is not propagated correctly when a ScrollView is in children of ScrollView (notably causing trouble with ModernMenu on ContactList and FileSharing widgets). To avoid that, a simple StencilView with BoxLayout is now used instead. If a ScrollView is needed, it can be added inside the widget (this is the case for WidgetSelector).
author Goffi <goffi@goffi.org>
date Mon, 27 Jan 2020 21:17:08 +0100
parents 4d3a0c4f2430
children 4d660b252487
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_widget_selector.py	Mon Jan 27 21:17:08 2020 +0100
+++ b/cagou/plugins/plugin_wid_widget_selector.py	Mon Jan 27 21:17:08 2020 +0100
@@ -45,11 +45,12 @@
     def on_release(self, *args):
         log.debug("widget selection: {}".format(self.plugin_info["name"]))
         factory = self.plugin_info["factory"]
-        G.host.switchWidget(self, factory(self.plugin_info, None, profiles=iter(G.host.profiles)))
+        G.host.switchWidget(
+            self, factory(self.plugin_info, None, profiles=iter(G.host.profiles)))
 
 
 class WidgetSelector(cagou_widget.CagouWidget):
-    # TODO: should inherit from QuickWidget
+    container = properties.ObjectProperty()
 
     def __init__(self):
         super(WidgetSelector, self).__init__()
@@ -58,8 +59,8 @@
             item = WidgetSelItem(plugin_info=plugin_info)
             self.items.append(item.item)
             item.item.bind(minimum_width=self.adjust_width)
-            self.add_widget(item)
-        self.add_widget(Widget())
+            self.container.add_widget(item)
+        self.container.add_widget(Widget())
 
     def adjust_width(self, label, texture_size):
         width = max([i.minimum_width for i in self.items])