From d691db7ccd327e95eca6cc63dc65540821611129 Mon Sep 17 00:00:00 2001 From: JackAnderson5 Date: Wed, 3 Aug 2016 09:27:33 +0300 Subject: [PATCH 1/4] typo --- kivy/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kivy/app.py b/kivy/app.py index 962a61928..9a34fa297 100644 --- a/kivy/app.py +++ b/kivy/app.py @@ -169,9 +169,9 @@ user in order to adapt or reload your UI. You can then overload the if config is self.config: token = (section, key) if token == ('section1', 'key1'): - print('Our key1 have been changed to', value) + print('Our key1 has been changed to', value) elif token == ('section1', 'key2'): - print('Our key2 have been changed to', value) + print('Our key2 has been changed to', value) The Kivy configuration panel is added by default to the settings instance. If you don't want this panel, you can declare your Application as From c08917336a6dd4ca6f2ce609b0187a0c51e4034a Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Wed, 3 Aug 2016 18:08:42 -0400 Subject: [PATCH 2/4] Always pop the touch. --- kivy/uix/scrollview.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kivy/uix/scrollview.py b/kivy/uix/scrollview.py index f13a32df6..329ae2fe1 100644 --- a/kivy/uix/scrollview.py +++ b/kivy/uix/scrollview.py @@ -596,6 +596,7 @@ class ScrollView(StencilView): touch.push() touch.apply_transform_2d(self.to_local) if self.dispatch_children('on_scroll_start', touch): + touch.pop() return True touch.pop() @@ -730,6 +731,7 @@ class ScrollView(StencilView): touch.push() touch.apply_transform_2d(self.to_local) if self.dispatch_children('on_scroll_move', touch): + touch.pop() return True touch.pop() @@ -810,6 +812,7 @@ class ScrollView(StencilView): touch.push() touch.apply_transform_2d(self.to_local) if super(ScrollView, self).on_touch_up(touch): + touch.pop() return True touch.pop() return False @@ -828,6 +831,7 @@ class ScrollView(StencilView): touch.push() touch.apply_transform_2d(self.to_local) if self.dispatch_children('on_scroll_stop', touch): + touch.pop() return True touch.pop() From 88180cd6963068fa1c35959b6fd39769c8f2a9a4 Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Thu, 4 Aug 2016 19:40:52 -0400 Subject: [PATCH 3/4] Don't dismiss dropdown when clicking inside it. --- kivy/uix/dropdown.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kivy/uix/dropdown.py b/kivy/uix/dropdown.py index d896da0b7..4cfd474ce 100644 --- a/kivy/uix/dropdown.py +++ b/kivy/uix/dropdown.py @@ -314,6 +314,8 @@ class DropDown(ScrollView): return True if 'button' in touch.profile and touch.button.startswith('scroll'): return + if self.collide_point(*touch.pos): + return True if self.auto_dismiss: self.dismiss() From 5c8cc2ab89e6eec7a261c54b059a25f90587140a Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Thu, 4 Aug 2016 19:41:28 -0400 Subject: [PATCH 4/4] Don't re add all widgets upon resize, it just lead to infinite size calc. --- kivy/uix/spinner.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/kivy/uix/spinner.py b/kivy/uix/spinner.py index 86242a67a..1416b6b02 100644 --- a/kivy/uix/spinner.py +++ b/kivy/uix/spinner.py @@ -117,7 +117,7 @@ class Spinner(Button): .. versionadded:: 1.4.0 ''' - + sync_height = BooleanProperty(False) '''Each element in a dropdown list uses a default/user-supplied height. Set to True to propagate the Spinner's height value to each dropdown @@ -138,7 +138,7 @@ class Spinner(Button): fbind('dropdown_cls', build_dropdown) fbind('option_cls', build_dropdown) fbind('values', self._update_dropdown) - fbind('size', self._update_dropdown) + fbind('size', self._update_dropdown_size) fbind('text_autoupdate', self._update_dropdown) build_dropdown() @@ -156,6 +156,19 @@ class Spinner(Button): self._dropdown.bind(on_dismiss=self._close_dropdown) self._update_dropdown() + def _update_dropdown_size(self, *largs): + if not self.sync_height: + return + dp = self._dropdown + if not dp: + return + + container = dp.container + if not container: + return + for value in container.children: + item.height = self.height + def _update_dropdown(self, *largs): dp = self._dropdown cls = self.option_cls