def draw(self, context, layout): if self.get_window().is_active(): c = (40.0 / 255.0, 40.0 / 255.0, 40.0 / 255.0) else: c = (145.0 / 255.0, 145.0 / 255.0, 145.0 / 255.0) widgetutil.round_rect(context, 0, 0, context.width, context.height, 5) context.set_color(c) context.fill()
def draw(self, context, layout): # we draw the rectangle off the bottom so that it's flat widgetutil.round_rect(context, 0, 0, context.width, context.height + 10, 10) context.set_color(widgetutil.css_to_color('#9199bd')) context.fill() widgetutil.round_rect_reverse(context, 1, 1, context.width - 2, context.height + 10, 10) context.set_color(widgetutil.css_to_color('#bec1d0')) context.fill()
def draw(self, context, layout): widgetutil.draw_rounded_icon(context, self.icon, 0, 0, 41, 41, inset=1) context.set_line_width(1) # Draw the black inner border context.set_color((0, 0, 0), 0.16) widgetutil.round_rect(context, 1.5, 1.5, 38, 38, 3) context.stroke() # Draw the white outer border context.set_color((1, 1, 1), 0.76) widgetutil.round_rect(context, 0.5, 0.5, 40, 40, 3) context.stroke()
def draw(self, context, layout): width, height = self.get_width(), self.get_height() x, y = (context.width - width) / 2, (context.height - height) / 2 widgetutil.round_rect(context, x, y, width, height, 20) context.set_color(self.BG_COLOR) context.fill() widgetutil.round_rect(context, x, y, width, height, 20) widgetutil.round_rect_reverse(context, x+1, y+1, width-2, height-2, 20) context.set_color(self.BORDER_COLOR) context.fill() total = y for child in self.children_start[:-1]: total += child.get_height() context.rectangle(x, total, width, 1) context.fill() widgetset.Background.draw(self, context, layout)
def draw(self, context, layout): width, height = self.get_width(), self.get_height() x, y = (context.width - width) / 2, (context.height - height) / 2 widgetutil.round_rect(context, x, y, width, height, 20) context.set_color(self.BG_COLOR) context.fill() widgetutil.round_rect(context, x, y, width, height, 20) widgetutil.round_rect_reverse(context, x + 1, y + 1, width - 2, height - 2, 20) context.set_color(self.BORDER_COLOR) context.fill() total = y for child in self.children_start[:-1]: total += child.get_height() context.rectangle(x, total, width, 1) context.fill() widgetset.Background.draw(self, context, layout)
def draw(self, context, layout): if ((self.state == 'hover' or self.state == 'pressed' or self._sort_state != self.SORT_NONE)): if self._sort_state != self.SORT_NONE: context.set_color((0.29, 0.29, 0.29)) else: context.set_color((0.7, 0.7, 0.7)) widgetutil.round_rect(context, 0.5, 0.5, context.width - 2, context.height - 2, 8) context.fill() layout.set_font(0.8, bold=True) layout.set_text_color((1, 1, 1)) textbox = layout.textbox(self._text) text_size = textbox.get_size() y = int((context.height - textbox.get_size()[1]) / 2) - 1.5 textbox.draw(context, 12, y, text_size[0], text_size[1]) context.set_color((1, 1, 1)) self._draw_triangle(context, text_size[0] + 18)