From f814fbc5beea9087026e00b6ae6393492d4436c8 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 15 Dec 2013 23:42:18 +0100 Subject: add HSpace layout component --- ptlayout.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ptlayout.py') 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__() -- cgit v1.2.1