Skip to content

Commit a07937e

Browse files
committed
Merge pull request kivy#1812 from kivy/1810
uix:splitter fix 1810
2 parents 19c98e8 + 8ba1786 commit a07937e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

kivy/uix/splitter.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ def __init__(self, **kwargs):
136136
self._container = None
137137
self._strip = None
138138
super(Splitter, self).__init__(**kwargs)
139+
self.bind(size=self._do_size,
140+
max_size=self._do_size,
141+
min_size=self._do_size)
139142

140143
def on_sizable_from(self, instance, sizable_from):
141144
if not instance._container:
@@ -215,6 +218,12 @@ def strip_down(self, instance, touch):
215218
def on_press(self):
216219
pass
217220

221+
def _do_size(self, instance, value):
222+
if self.sizable_from[0] in ('l', 'r'):
223+
self.width = max(self.min_size, min(self.width, self.max_size))
224+
else:
225+
self.height = max(self.min_size, min(self.height, self.max_size))
226+
218227
def strip_move(self, instance, touch):
219228
if touch.grab_current is not instance:
220229
return False

0 commit comments

Comments
 (0)