Esempio n. 1
0
    def cycle_tiler(self):
        for i in range(len(Config.misc('tilers'))):
            if Config.misc('tilers')[i] is self.__class__.__name__:
                if (i + 1) == len(Config.misc('tilers')):
                    self.screen.set_tiler(Config.tilers(Config.misc('tilers')[0]))
                else:
                    self.screen.set_tiler(Config.tilers(Config.misc('tilers')[i + 1]))

        self._reset()
Esempio n. 2
0
    def help_resize(self,
                    window,
                    x,
                    y,
                    width,
                    height,
                    margin=0,
                    intMargin=None,
                    intBorders={
                        't': False,
                        'l': False,
                        'r': False,
                        'b': False
                    }):
        if intMargin == None:
            intMargin = margin

        x += intMargin if intBorders['l'] else margin
        y += intMargin if intBorders['t'] else margin
        if intBorders['l']:
            width -= intMargin
        else:
            width -= margin

        if intBorders['r']:
            width -= intMargin
        else:
            width -= margin

        if intBorders['t']:
            height -= intMargin
        else:
            height -= margin

        if intBorders['b']:
            height -= intMargin
        else:
            height -= margin

        if window.static:
            window.remove_static_property()

        if Config.misc('decorations'):
            if not Config.misc('original_decor'):
                window.add_decorations()

            window.resize(int(x), int(y),
                          int(width - window.d_left - window.d_right),
                          int(height - window.d_top - window.d_bottom))
        else:
            if Config.misc('original_decor'):
                window.remove_decorations()

            window.resize(int(x), int(y), int(width - 2), int(height - 2))
Esempio n. 3
0
 def __init__(self, viewport, attrs):
     self.update_attributes(attrs)
     self._active = None
     self._tile = None
     self._tiled = False
     self._tiling = Config.misc('global_tiling')
     self.windows = {}
     self.viewport = viewport
Esempio n. 4
0
 def __init__(self, viewport, attrs):
     self.update_attributes(attrs)
     self._active = None
     self._tile = None
     self._tiled = False
     self._tiling = Config.misc('global_tiling')
     self.windows = {}
     self.viewport = viewport
Esempio n. 5
0
    def _untile(self):
        # just resize all the windows back to their original x/y/width/height
        for window in self.storage.get_all():
            if Config.misc('original_decor'):
                window.add_decorations()
            else:
                window.remove_decorations()

            window.resize(window.origx, window.origy, window.origwidth, window.origheight)
Esempio n. 6
0
    def help_resize(self, window, x, y, width, height, margin = 0):
        if margin > 0:
            x += margin
            y += margin
            width -= (2 * margin)
            height -= (2 * margin)

        if window.static:
            window.remove_static_property()

        if Config.misc('decorations'):
            if not Config.misc('original_decor'):
                window.add_decorations()

            window.resize(int(x), int(y), int(width - window.d_left - window.d_right), int(height - window.d_top - window.d_bottom))
        else:
            if Config.misc('original_decor'):
                window.remove_decorations()

            window.resize(int(x), int(y), int(width - 2), int(height - 2))