From da7e7850b0be50f8977650b218196407f6b3218e Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 27 Feb 2010 15:18:08 +0100 Subject: [PATCH] Add support for window sizes in the layout --- terminatorlib/config.py | 1 + terminatorlib/container.py | 3 +++ terminatorlib/terminator.py | 3 +++ 3 files changed, 7 insertions(+) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 613f990b..56af599d 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -468,6 +468,7 @@ class ConfigBase(Borg): section['profile'] = 'string(default=default)' section['command'] = 'string(default="")' section['position'] = 'string(default="")' + section['size'] = 'list(default=list(-1,-1))' configspecdata['layouts'] = {} configspecdata['layouts']['__many__'] = {} configspecdata['layouts']['__many__']['__many__'] = section diff --git a/terminatorlib/container.py b/terminatorlib/container.py index 286a8ca9..37b6ef6f 100755 --- a/terminatorlib/container.py +++ b/terminatorlib/container.py @@ -208,6 +208,9 @@ the %s will also close all terminals within it.') % (reqtype, reqtype)) position = ':'.join([str(x) for x in position]) layout['position'] = position + if hasattr(self, 'get_size'): + layout['size'] = self.get_size() + name = 'child%d' % count count = count + 1 diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 6089d325..eb3c67be 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -175,6 +175,9 @@ class Terminator(Borg): parts = layout[windef]['position'].split(':') if len(parts) == 2: window.move(int(parts[0]), int(parts[1])) + if layout[windef].has_key('size'): + parts = layout[windef]['size'] + window.resize(int(parts[0]), int(parts[1])) def layout_done(self): """Layout operations have finished, record that fact"""