Add support for window sizes in the layout
This commit is contained in:
parent
499206f3e9
commit
da7e7850b0
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"""
|
||||
|
|
Loading…
Reference in New Issue