def command(self, mask, command, *args, **kwargs): if command == 'ratio': ratio = self.command_get_arg(args, kwargs, 'ratio', self.ratio) self.ratio = ratio self.clientStack.group.layoutAll() elif command == 'incratio': incr = self.command_get_arg(args, kwargs, 'incr', 0.1) self.ratio += incr if self.ratio < 0: self.ratio = 0 if self.ratio > 1: self.ratio = 1.0 self.clientStack.group.layoutAll() elif command == 'incnmaster': incr = self.command_get_arg(args, kwargs, 'incr', 1) self.master_windows += incr if self.master_windows < 1: self.master_windows = 1 #don't let it drop below one - not set up to cope with this yet self.clientStack.group.layoutAll() elif command == 'nextarrangement': self.arrangement = self.arrangements[(self.arrangements.index(self.arrangement) + 1) % len(self.arrangements)] self.clientStack.group.layoutAll() SubLayout.command(self, mask, command, *args, **kwargs)
def __init__(self, clientStack, theme, parent=None, autohide=True, master_windows=1, ratio=0.618, arrangement="left", expand=True): self.master_windows = master_windows self.ratio = ratio self.arrangement = (arrangement if arrangement in self.arrangements else self.arrangements[0]) self.expand = expand SubLayout.__init__(self, clientStack, theme, parent, autohide)
def __init__(self, clientStack, theme, parent=None, ratio=0.7): self.ratio = ratio SubLayout.__init__(self, clientStack, theme, parent)