Mercurial > libervia-desktop-kivy
diff cagou/core/widgets_handler.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 | e1f56257cabc |
children | 4d660b252487 |
line wrap: on
line diff
--- a/cagou/core/widgets_handler.py Mon Jan 27 21:17:08 2020 +0100 +++ b/cagou/core/widgets_handler.py Mon Jan 27 21:17:08 2020 +0100 @@ -26,7 +26,6 @@ from kivy.uix.stencilview import StencilView from kivy.uix.carousel import Carousel from kivy.uix.screenmanager import ScreenManager, Screen -from kivy.uix.scrollview import ScrollView from kivy.metrics import dp from kivy import properties from cagou import G @@ -40,6 +39,10 @@ MIN_WIDTH = MIN_HEIGHT = dp(70) +class BoxStencil(BoxLayout, StencilView): + pass + + class WHWrapper(BoxLayout): main_container = properties.ObjectProperty(None) screen_manager = properties.ObjectProperty(None, allownone=True) @@ -371,7 +374,7 @@ if wid.collection_carousel or wid.global_screen_manager: self.main_container = self else: - self.main_container = ScrollView() + self.main_container = BoxStencil() self.add_widget(self.main_container) if self.carousel is not None: