From fdd81c41acf1531198d242700e0326575de078f0 Mon Sep 17 00:00:00 2001 From: Ian Foote Date: Sun, 7 Apr 2013 17:14:29 +0100 Subject: [PATCH] Reorder BoxLayout padding property. --- kivy/uix/boxlayout.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/kivy/uix/boxlayout.py b/kivy/uix/boxlayout.py index 689372604..04d101aea 100644 --- a/kivy/uix/boxlayout.py +++ b/kivy/uix/boxlayout.py @@ -76,16 +76,11 @@ class BoxLayout(Layout): ''' 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 @@ -123,10 +118,10 @@ class BoxLayout(Layout): selfy = self.y selfw = self.width selfh = self.height - 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] spacing = self.spacing orientation = self.orientation padding_x = padding_left + padding_right