Example #1
0
    def draw(self, **kwargs):
        hint  = kwargs.get("hint", "tblr")
        color = conf.stack_unfocused_color
        light = conf.stack_unfocused_highlight
        dark  = conf.stack_unfocused_shadow

        if self.focused:
            color = conf.stack_focused_color
            light = conf.stack_focused_highlight
            dark  = conf.stack_focused_shadow

        x = self.x
        y = self.y
        w = self.w
        h = self.h

        left  = x
        right = x + w - 1
        top   = y
        bot   = y + h - 1

        pypixel.rectangle(color, self.rect)

        # Draw light edge
        if "t" in hint: pypixel.line(light, (left, top), (right, top)) # top
        if "l" in hint: pypixel.line(light, (left, top), (left,  bot)) # left

        # Draw dark edge
        if "r" in hint: pypixel.line(dark, (right, bot), (right, top)) # right
        if "b" in hint: pypixel.line(dark, (right, bot), (left,  bot)) # bottom

        item = self.item()
        if item is not None:
            item.draw()
Example #2
0
    def draw(self, **kwargs):
        hint = kwargs.get("hint", "tblr")
        color = conf.stack_unfocused_color
        light = conf.stack_unfocused_highlight
        dark = conf.stack_unfocused_shadow

        if self.focused:
            color = conf.stack_focused_color
            light = conf.stack_focused_highlight
            dark = conf.stack_focused_shadow

        x = self.x
        y = self.y
        w = self.w
        h = self.h

        left = x
        right = x + w - 1
        top = y
        bot = y + h - 1

        pypixel.rectangle(color, self.rect)

        # Draw light edge
        if "t" in hint: pypixel.line(light, (left, top), (right, top))  # top
        if "l" in hint: pypixel.line(light, (left, top), (left, bot))  # left

        # Draw dark edge
        if "r" in hint: pypixel.line(dark, (right, bot), (right, top))  # right
        if "b" in hint: pypixel.line(dark, (right, bot), (left, bot))  # bottom

        item = self.item()
        if item is not None:
            item.draw()
Example #3
0
    def draw_fullscreen(self, screen):
        tag = screen.item()
        w = tag.w
        h = tag.h
        x = 0
        y = tag.y_offset

        pypixel.rectangle(self.color, ((x, y), (w, h)))
Example #4
0
    def draw_fullscreen(self, screen):
        tag = screen.item()
        w = tag.w
        h = tag.h
        x = 0
        y = tag.y_offset

        pypixel.rectangle(self.color, ((x, y), (w, h)))
Example #5
0
    def draw_bar(self):
        screen = self.display.item()
        tag    = screen.item()

        if tag.bar_hidden:
            return

        color     = conf.bar_color
        highlight = conf.bar_highlight
        bh        = conf.bar_height

        # Top bar
        x, y = 0, 0
        w, h = screen.dim
        rect = ((x, y),      (w,     bh))     # (x, y), (w, h)
        line = ((x, y - 2 + bh), (w - 1, y - 2 + bh)) # (x, y), (x, y)

        pypixel.rectangle(color, rect)
        pypixel.line(highlight, *line)
Example #6
0
    def draw(self):
        colr3 = conf.window_unfocused_shadow
        colr2 = conf.window_unfocused_highlight
        colr1 = self.color

        if self.focused:
            colr3 = conf.window_focused_shadow
            colr2 = conf.window_focused_highlight

        x = self.x
        y = self.y
        w = self.w
        h = self.h
        q = 2; rec1 = ((x + q, y + q), (w - q - q, h - q - q))
        q = 1; rec2 = ((x + q, y + q), (w - q - q, h - q - q))
        pass;  rec3 = self.rect

        pypixel.rectangle(colr3, rec3)
        pypixel.rectangle(colr2, rec2)
        pypixel.rectangle(colr1, rec1)
Example #7
0
    def draw(self):
        colr3 = conf.window_unfocused_shadow
        colr2 = conf.window_unfocused_highlight
        colr1 = self.color

        if self.focused:
            colr3 = conf.window_focused_shadow
            colr2 = conf.window_focused_highlight

        x = self.x
        y = self.y
        w = self.w
        h = self.h
        q = 2
        rec1 = ((x + q, y + q), (w - q - q, h - q - q))
        q = 1
        rec2 = ((x + q, y + q), (w - q - q, h - q - q))
        pass
        rec3 = self.rect

        pypixel.rectangle(colr3, rec3)
        pypixel.rectangle(colr2, rec2)
        pypixel.rectangle(colr1, rec1)