Skip to content

Instantly share code, notes, and snippets.

View jb1123's full-sized avatar

Jacek Blocki jb1123

View GitHub Profile
@jb1123
jb1123 / sample.kv
Created April 16, 2018 10:08
canvas and canvas.after
LockerLayout:
id: locker1
lockerid: 0
orientation: 'horizontal'
locker_size: [.05, .8, .05]
LockerLayout:
id: locker2
lockerid: 1
orientation: 'vertical'
locker_size: [.9, .1]
@jb1123
jb1123 / lockerlayout.py
Created April 24, 2018 21:41
LockerLayout - adding kivy widgets to predefined boxes in desired sequence
class LockerLayout(Layout):
"""Spacing between children, in pixels."""
spacing = NumericProperty(0)
"""Padding between layout box and children: [padding_left, padding_top, padding_right, padding_bottom]"""
padding = VariableListProperty()
"""size of lockers for attaching widgets, layout space divided among lockers proportionally to locker_size"""
locker_size = ListProperty()
"""Orientation of the layout."""
orientation = OptionProperty('horizontal', options=('horizontal', 'vertical'))
"""locker box size ad position"""