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

Adding padding to a widget #229

Closed
Mysterken opened this issue Dec 15, 2020 · 5 comments · Fixed by #236
Closed

Adding padding to a widget #229

Mysterken opened this issue Dec 15, 2020 · 5 comments · Fixed by #236

Comments

@Mysterken
Copy link

If I'm not mistaken, there's currently no way to add padding to a widget.
In my case it's a problem if I want the left and right border of each buttons to align:

Capture d’écran (182)

Would an implementation of an optional widget_padding argument be possible?

@ppizarror
Copy link
Owner

Yep, it's entirely possible. I'll look for an implementation of widget_padding

@ppizarror
Copy link
Owner

ppizarror commented Jan 1, 2021

Padding has been implemented. Some possible combinations:

menu.add_button(0, pygame_menu.events.NONE, padding=25)
menu.add_button(0, pygame_menu.events.NONE, padding=(25, 25, 25, 25))
menu.add_button(0, pygame_menu.events.NONE, padding=(25, 50, 75, 100))
menu.add_button(0, pygame_menu.events.NONE, padding=(25, 50))
menu.add_button(0, pygame_menu.events.NONE, padding=(25, 75, 50))

This is entirely experimental. Some issues should be resolved but I need user feedback. I'll create a new version today, hope this resolves your issue

@ppizarror
Copy link
Owner

Padding rules are the same as CSS https://www.w3schools.com/css/css_padding.asp

@ppizarror
Copy link
Owner

I'll leave this issue opened for suggestions or further feedback after v340 is released

@ppizarror
Copy link
Owner

New version 3.4.0 released. If there's any feedback, suggestion or bug please create a new issue or a PR

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

Successfully merging a pull request may close this issue.

2 participants