Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add padding between AnchorLayout and children #1981

Merged

Conversation

mihaineacsu
Copy link
Contributor

Fixes issue #1980: if size_hint is not None, specified padding should be deducted from children's size.

@mihaineacsu mihaineacsu changed the title Add padding between layout and children Add padding between AnchorLayout and children Mar 18, 2014
@@ -83,11 +83,11 @@ def do_layout(self, *largs):
x, y = _x, _y
w, h = c.size
if c.size_hint[0]:
w = c.size_hint[0] * width
w = (c.size_hint[0] * width) - (2 * padding)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

padding is a VariableListProperty so one can have padding[0] for the left be different from padding[2] for the right side. You need to account for that.

@ghost
Copy link

ghost commented Mar 20, 2014

@akshayaurora Padding is a NumericProperty in the case of AnchorLayout.
https://github.com/kivy/kivy/blob/master/kivy/uix/anchorlayout.py#L38

@akshayaurora
Copy link
Member

@Voen I see it wasn't updated with the rest of the layouts. In order to make it consistent with the rest of the layouts we should be using a VariablelistProeprty for padding. @mihaineacsu could you please look into changing padding to use a VariableListProperty?

@mihaineacsu
Copy link
Contributor Author

@akshayaurora sure, will do!

Calculate horizontal and vertical padding correctly
akshayaurora added a commit that referenced this pull request Mar 20, 2014
…issue

Add padding between AnchorLayout and children
@akshayaurora akshayaurora merged commit e4300d8 into kivy:master Mar 20, 2014
@akshayaurora
Copy link
Member

@mihaineacsu thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants