From 5b368a036d3edff792f2c1c05912d4073a7b73d7 Mon Sep 17 00:00:00 2001 From: Ian Foote Date: Sun, 7 Apr 2013 17:20:22 +0100 Subject: [PATCH] Reorder StackLayout padding property. --- kivy/uix/stacklayout.py | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/kivy/uix/stacklayout.py b/kivy/uix/stacklayout.py index 4451a9a46..4549c03f0 100644 --- a/kivy/uix/stacklayout.py +++ b/kivy/uix/stacklayout.py @@ -37,29 +37,20 @@ class StackLayout(Layout): ''' spacing = VariableListProperty([0, 0], length=2) - '''Spacing between children, in pixels. + '''Spacing between children: [spacing_horizontal, spacing_vertical]. - spacing[0] represents the horizontal spacing and spacing[1] the vertical - spacing. - - If spacing is given only one argument, it will represent both horizontal - and vertical spacing. + spacing also accepts a one argument form [spacing]. :data:`spacing` is a :class:`~kivy.properties.VariableListProperty`, default to [0, 0]. ''' padding = VariableListProperty([0, 0, 0, 0]) - '''Padding between layout box and children, in pixels. + '''Padding between layout box and children: [padding_left, padding_top, + padding_right, padding_bottom]. - padding[0] represents the top padding, padding[1] the right padding, - padding[2] the bottom padding and padding[3] the left padding. - - If padding is given only two arguments, the first will represent top and - bottom padding, and the second left and right padding. - - If padding is given only one argument, it will represent all four - directions. + padding also accepts a two argument form [padding_horizontal, + padding_vertical] and a one argument form [padding]. .. versionchanged:: 1.7.0 @@ -137,10 +128,10 @@ class StackLayout(Layout): selfpos = self.pos selfsize = self.size orientation = self.orientation.split('-') - padding_top = self.padding[0] - padding_right = self.padding[1] - padding_bottom = self.padding[2] - padding_left = self.padding[3] + padding_left = self.padding[0] + padding_top = self.padding[1] + padding_right = self.padding[2] + padding_bottom = self.padding[3] padding_x = padding_left + padding_right padding_y = padding_top + padding_bottom