garden.layoutmargin
A set of mixins (MarginLayout
, AddMargin
) that adds margin
functionality to Kivy widgets.
How to use
@ .py
subclasses:
from layoutmargin import AddMargin, MarginLayout
class MarginBoxLayout(MarginLayout, BoxLayout):
pass
class MarginButton(AddMargin, Button):
pass
@ .kv
layout:
MarginBoxLayout:
MarginButton:
margin: (30, 10, 30, 10)
MarginButton:
margin: ("10%", "10%", "10%", "10%")
MarginButton:
margin: (30, "10%", 30, "10%")
Run the demo
make run
Install
pip install layoutmargin
Credits
Forked from Enteleform/-Kivy-MarginLayout-Demo.