mirror of https://github.com/kivy/kivy.git
layout: fix issue when layout are not relayout themself after an add to parent.
This commit is contained in:
parent
7fea0de319
commit
3b63176d90
|
@ -14,7 +14,6 @@ To draw a button in the lower-right corner ::
|
||||||
|
|
||||||
__all__ = ('AnchorLayout', )
|
__all__ = ('AnchorLayout', )
|
||||||
|
|
||||||
from kivy.clock import Clock
|
|
||||||
from kivy.uix.layout import Layout
|
from kivy.uix.layout import Layout
|
||||||
from kivy.properties import NumericProperty, OptionProperty
|
from kivy.properties import NumericProperty, OptionProperty
|
||||||
|
|
||||||
|
@ -49,6 +48,7 @@ class AnchorLayout(Layout):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(AnchorLayout, self).__init__(**kwargs)
|
super(AnchorLayout, self).__init__(**kwargs)
|
||||||
self.bind(
|
self.bind(
|
||||||
|
parent = self._trigger_layout,
|
||||||
padding = self._trigger_layout,
|
padding = self._trigger_layout,
|
||||||
anchor_x = self._trigger_layout,
|
anchor_x = self._trigger_layout,
|
||||||
anchor_y = self._trigger_layout,
|
anchor_y = self._trigger_layout,
|
||||||
|
|
|
@ -76,6 +76,7 @@ class BoxLayout(Layout):
|
||||||
padding = self._trigger_layout,
|
padding = self._trigger_layout,
|
||||||
children = self._trigger_layout,
|
children = self._trigger_layout,
|
||||||
orientation = self._trigger_layout,
|
orientation = self._trigger_layout,
|
||||||
|
parent = self._trigger_layout,
|
||||||
size = self._trigger_layout,
|
size = self._trigger_layout,
|
||||||
pos = self._trigger_layout)
|
pos = self._trigger_layout)
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,6 @@ class GridLayout(Layout):
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self._cols = self._rows = None
|
self._cols = self._rows = None
|
||||||
self._trigger_layout = Clock.create_trigger(self.do_layout, -1)
|
|
||||||
super(GridLayout, self).__init__(**kwargs)
|
super(GridLayout, self).__init__(**kwargs)
|
||||||
|
|
||||||
self.bind(
|
self.bind(
|
||||||
|
@ -223,6 +222,7 @@ class GridLayout(Layout):
|
||||||
row_force_default = self._trigger_layout,
|
row_force_default = self._trigger_layout,
|
||||||
cols = self._trigger_layout,
|
cols = self._trigger_layout,
|
||||||
rows = self._trigger_layout,
|
rows = self._trigger_layout,
|
||||||
|
parent = self._trigger_layout,
|
||||||
spacing = self._trigger_layout,
|
spacing = self._trigger_layout,
|
||||||
padding = self._trigger_layout,
|
padding = self._trigger_layout,
|
||||||
children = self._trigger_layout,
|
children = self._trigger_layout,
|
||||||
|
|
Loading…
Reference in New Issue