summaryrefslogtreecommitdiff
path: root/ptlayout.py
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2013-12-15 23:42:18 +0100
committerDavid Lamparter <equinox@diac24.net>2013-12-15 23:42:18 +0100
commitf814fbc5beea9087026e00b6ae6393492d4436c8 (patch)
treefd94ed82e59abc2878fe485828145de7901625e0 /ptlayout.py
parentd29a09bee752791c977088a2de7dd09e5f436116 (diff)
add HSpace layout component
Diffstat (limited to 'ptlayout.py')
-rw-r--r--ptlayout.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/ptlayout.py b/ptlayout.py
index 07266b3..219052e 100644
--- a/ptlayout.py
+++ b/ptlayout.py
@@ -132,6 +132,22 @@ class PTLContainer(PTLayoutElem):
def add(self, child):
self._children.append(child)
+class PTLHSpace(PTLContainer):
+ def __init__(self):
+ super(PTLHSpace, self).__init__()
+ self.spacing = '5'
+
+ def prep_size(self, hh):
+ return (int(self.spacing), 0)
+
+ def render(self, cctx, h):
+ return int(self.spacing)
+
+ def properties(self):
+ return [
+ ('spacing', 'text'),
+ ]
+
class PTLHSeq(PTLContainer):
def __init__(self):
super(PTLHSeq, self).__init__()