Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andremiras/garden.layoutmargin
Mixins that adds margin functionality to Kivy widgets
https://github.com/andremiras/garden.layoutmargin
Last synced: 10 days ago
JSON representation
Mixins that adds margin functionality to Kivy widgets
- Host: GitHub
- URL: https://github.com/andremiras/garden.layoutmargin
- Owner: AndreMiras
- License: mit
- Created: 2018-05-16T21:49:14.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2019-09-11T22:35:41.000Z (over 5 years ago)
- Last Synced: 2025-01-01T22:32:03.905Z (11 days ago)
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# garden.layoutmargin
[![Build Status](https://travis-ci.com/AndreMiras/garden.layoutmargin.svg?branch=develop)](https://travis-ci.com/AndreMiras/garden.layoutmargin)
[![PyPI version](https://badge.fury.io/py/layoutmargin.svg)](https://badge.fury.io/py/layoutmargin)A set of mixins (`MarginLayout`, `AddMargin`) that adds `margin` functionality to Kivy widgets.
![demo](http://i.imgur.com/4cCZL3t.gif)
## How to use
### @ `.py` subclasses:
```python
from layoutmargin import AddMargin, MarginLayoutclass MarginBoxLayout(MarginLayout, BoxLayout):
pass
class MarginButton(AddMargin, Button):
pass
```### @ `.kv` layout:
```yaml
MarginBoxLayout:
MarginButton:
margin: (30, 10, 30, 10) # integer / float
MarginButton:
margin: ("10%", "10%", "10%", "10%") # percentage of total widget size
MarginButton:
margin: (30, "10%", 30, "10%") # mixed
```## Run the demo
```
make run
```## Install
```sh
pip install layoutmargin
```## Credits
Forked from [Enteleform/-Kivy-MarginLayout-Demo](https://github.com/Enteleform/-Kivy-MarginLayout-Demo).