From f53c86e0880df0ee070810d1ddf473fc4d9db02e Mon Sep 17 00:00:00 2001 From: Ian Foote Date: Sun, 24 Mar 2013 23:19:00 +0000 Subject: [PATCH] Change padding order to match css padding. --- kivy/uix/boxlayout.py | 14 +++++++------- kivy/uix/gridlayout.py | 16 ++++++++-------- kivy/uix/stacklayout.py | 14 +++++++------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/kivy/uix/boxlayout.py b/kivy/uix/boxlayout.py index a244b23cd..e1d613713 100644 --- a/kivy/uix/boxlayout.py +++ b/kivy/uix/boxlayout.py @@ -78,11 +78,11 @@ class BoxLayout(Layout): padding = CssListProperty([0, 0, 0, 0]) '''Padding between layout box and children, in pixels. - padding[0] represents the left padding, padding[1] the right padding, - padding[2] the top padding and padding[3] the bottom padding. + 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 left and - right padding, and the second top and bottom 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. @@ -122,10 +122,10 @@ class BoxLayout(Layout): selfy = self.y selfw = self.width selfh = self.height - padding_left = self.padding[0] + padding_top = self.padding[0] padding_right = self.padding[1] - padding_top = self.padding[2] - padding_bottom = self.padding[3] + padding_bottom = self.padding[2] + padding_left = self.padding[3] spacing = self.spacing orientation = self.orientation padding_x = padding_left + padding_right diff --git a/kivy/uix/gridlayout.py b/kivy/uix/gridlayout.py index 703f0fa26..e87738c96 100644 --- a/kivy/uix/gridlayout.py +++ b/kivy/uix/gridlayout.py @@ -114,11 +114,11 @@ class GridLayout(Layout): padding = CssListProperty([0, 0, 0, 0]) '''Padding between layout box and children, in pixels. - padding[0] represents the left padding, padding[1] the right padding, - padding[2] the top padding and padding[3] the bottom padding. + 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 left and - right padding, and the second top and bottom 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. @@ -344,8 +344,8 @@ class GridLayout(Layout): i = i - 1 # calculate minimum width/height needed, starting from padding + spacing - padding_x = self.padding[0] + self.padding[1] - padding_y = self.padding[2] + self.padding[3] + padding_x = self.padding[1] + self.padding[3] + padding_y = self.padding[0] + self.padding[2] spacing = self.spacing width = padding_x + spacing * (current_cols - 1) height = padding_y + spacing * (current_rows - 1) @@ -375,8 +375,8 @@ class GridLayout(Layout): return # speedup - padding_left = self.padding[0] - padding_top = self.padding[2] + padding_top = self.padding[0] + padding_left = self.padding[3] spacing = self.spacing selfx = self.x selfw = self.width diff --git a/kivy/uix/stacklayout.py b/kivy/uix/stacklayout.py index f136bf4d5..669aaa5b9 100644 --- a/kivy/uix/stacklayout.py +++ b/kivy/uix/stacklayout.py @@ -46,11 +46,11 @@ class StackLayout(Layout): padding = CssListProperty([0, 0, 0, 0]) '''Padding between layout box and children, in pixels. - padding[0] represents the left padding, padding[1] the right padding, - padding[2] the top padding and padding[3] the bottom padding. + 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 left and - right padding, and the second top and bottom 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. @@ -130,10 +130,10 @@ class StackLayout(Layout): selfpos = self.pos selfsize = self.size orientation = self.orientation.split('-') - padding_left = self.padding[0] + padding_top = self.padding[0] padding_right = self.padding[1] - padding_top = self.padding[2] - padding_bottom = self.padding[3] + padding_bottom = self.padding[2] + padding_left = self.padding[3] padding_x = padding_left + padding_right padding_y = padding_top + padding_bottom