def drawTrack(self): from miro.frontends.widgets import widgetutil rect = self.bounds() ctx = drawing.DrawingContext(self, rect, rect) ctx.set_color((1,1,1), 0.4) widgetutil.circular_rect(ctx, 0, 2, rect.size.width, rect.size.height - 4) ctx.fill()
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 _outer_border(self, context): widgetutil.circular_rect(context, self.x, self.y, self.width, self.height)