mirror of https://github.com/kivy/kivy.git
boxlayout: ensure that any change of the size/size_hint/pos_hint will update the boxlayout.
This commit is contained in:
parent
cfb118cccf
commit
297dad858c
|
@ -190,3 +190,17 @@ class BoxLayout(Layout):
|
||||||
c.width = w
|
c.width = w
|
||||||
c.height = h
|
c.height = h
|
||||||
y += h + spacing
|
y += h + spacing
|
||||||
|
|
||||||
|
def add_widget(self, widget, index=0):
|
||||||
|
widget.bind(
|
||||||
|
size=self._trigger_layout,
|
||||||
|
size_hint=self._trigger_layout,
|
||||||
|
pos_hint=self._trigger_layout)
|
||||||
|
return super(Layout, self).add_widget(widget, index)
|
||||||
|
|
||||||
|
def remove_widget(self, widget):
|
||||||
|
widget.unbind(
|
||||||
|
size=self._trigger_layout,
|
||||||
|
size_hint=self._trigger_layout,
|
||||||
|
pos_hint=self._trigger_layout)
|
||||||
|
return super(Layout, self).remove_widget(widget)
|
||||||
|
|
Loading…
Reference in New Issue