def draw(self, context, layout): widgetutil.circular_rect(context, 0, 0, context.width, context.height) gradient = widgetset.Gradient(0, 0, 0, context.height) gradient.set_start_color(self.BACKGROUND_GRADIENT_TOP) gradient.set_end_color(self.BACKGROUND_GRADIENT_BOTTOM) context.gradient_fill(gradient) progress_width = ( (context.width - context.height) * self.progress_ratio + context.height) widgetutil.circular_rect_negative(context, 1, 1, progress_width - 2, context.height - 2) gradient = widgetset.Gradient(1, 1, 1, context.height - 2) gradient.set_start_color(self.PROGRESS_GRADIENT_TOP) gradient.set_end_color(self.PROGRESS_GRADIENT_BOTTOM) context.gradient_fill(gradient)
def _inner_border(self, context): widgetutil.circular_rect_negative(context, self.x + 1, self.y + 1, self.width - 2, self.height - 2)