Add support for window sizes in the layout

This commit is contained in:
Chris Jones 2010-02-27 15:18:08 +01:00
parent 499206f3e9
commit da7e7850b0
3 changed files with 7 additions and 0 deletions

View File

@ -468,6 +468,7 @@ class ConfigBase(Borg):
section['profile'] = 'string(default=default)' section['profile'] = 'string(default=default)'
section['command'] = 'string(default="")' section['command'] = 'string(default="")'
section['position'] = 'string(default="")' section['position'] = 'string(default="")'
section['size'] = 'list(default=list(-1,-1))'
configspecdata['layouts'] = {} configspecdata['layouts'] = {}
configspecdata['layouts']['__many__'] = {} configspecdata['layouts']['__many__'] = {}
configspecdata['layouts']['__many__']['__many__'] = section configspecdata['layouts']['__many__']['__many__'] = section

View File

@ -208,6 +208,9 @@ the %s will also close all terminals within it.') % (reqtype, reqtype))
position = ':'.join([str(x) for x in position]) position = ':'.join([str(x) for x in position])
layout['position'] = position layout['position'] = position
if hasattr(self, 'get_size'):
layout['size'] = self.get_size()
name = 'child%d' % count name = 'child%d' % count
count = count + 1 count = count + 1

View File

@ -175,6 +175,9 @@ class Terminator(Borg):
parts = layout[windef]['position'].split(':') parts = layout[windef]['position'].split(':')
if len(parts) == 2: if len(parts) == 2:
window.move(int(parts[0]), int(parts[1])) 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): def layout_done(self):
"""Layout operations have finished, record that fact""" """Layout operations have finished, record that fact"""