def do_paint(self): # Draw a rectangle for the clipping cogl.path_round_rectangle(0, 0, self._width, self._height, self._arc, self._step) cogl.path_close() # Start the clip cogl.clip_push_from_path() # set color to border color cogl.set_source_color(self._border_color) # draw the rectangle for the border which is the same size and the # object cogl.path_round_rectangle(0, 0, self._width, self._height, self._arc, self._step) cogl.path_close() # color the path usign the border color ##cogl.path_fill() #cogl.path_stroke() if True: #False: # set the color of the filled area cogl.set_source_color(self._color) # draw the content with is the same size minus the wirth of the border # finish the clip cogl.path_round_rectangle(self._border_width, self._border_width, self._width - self._border_width, self._height - self._border_width, self._arc, self._step) cogl.path_fill() cogl.path_close() cogl.clip_pop()
def paint_self(self): #self._border_width = self.get_border_width() (self._width, self._height) = self.get_size() if (self._width < self._border_width) or \ (self._height < self._border_width): return self._arc = 10 self._step = 10 cogl.path_polygon(0.0, 0.0, self._width, 0.0, 0.0, self._height) cogl.path_close() cogl.path_fill() glBegin(GL_TRIANGLES) # Draw the highlight glColor(*self._highlight_color) glVertex2f(0.0, self._height) glVertex2f(0,0) glVertex2f(self._width,0.0) # Draw the lowlight glColor(*self._lowlight_color) glVertex2f(self._width, self._height) glVertex2f(0.0, self._height) glVertex2f(self._width,0.0) # draw the middle glColor(*self._color) glVertex2f(self._border_width, self._height - self._border_width) glVertex2f(self._border_width,self._border_width) glVertex2f(self._width - self._border_width,self._border_width) glVertex2f(self._width - self._border_width, self._height - self._border_width) glVertex2f(self._border_width, self._height - self._border_width) glVertex2f(self._width - self._border_width,self._border_width) glEnd()
def __paint_triangle(self, width, height, color): cogl.path_move_to(width / 2, 0) cogl.path_line_to(width, height) cogl.path_line_to(0, height) cogl.path_line_to(width / 2, 0) cogl.path_close() cogl.set_source_color(color) cogl.path_fill()
def __paint_triangle (self, width, height, color): cogl.path_move_to(width / 2, 0) cogl.path_line_to(width, height) cogl.path_line_to(0, height) cogl.path_line_to(width / 2, 0) cogl.path_close() cogl.set_source_color(color) cogl.path_fill()
def __paint_triangle (self, color): cogl.push_matrix() cogl.set_source_color(color) width, height = self.get_geometry()[2:] # Paint a triangle cogl.path_polygon(0, 0, 0, height, width, height) cogl.path_fill() cogl.pop_matrix()
def __paint_triangle(self, color): cogl.push_matrix() cogl.set_source_color(color) width, height = self.get_geometry()[2:] # Paint a triangle cogl.path_polygon(0, 0, 0, height, width, height) cogl.path_fill() cogl.pop_matrix()
def do_paint(self): (x1,y1,x2,y2) = self.get_allocation_box() width=x2-x1 height=y2-y1 cogl.path_move_to(width / 2,0) cogl.path_line_to(width, height) cogl.path_line_to(0,height) cogl.path_line_to(width / 2, 0) cogl.path_close() cogl.set_source_color(self._color) cogl.path_fill()
def do_paint(self): """paint signal handler.""" w, h = self.get_size() color = self.trace.color dark_color = color.darken() cogl.set_source_color(dark_color) cogl.path_round_rectangle(0, 0, w, h, 5, 10) cogl.path_fill() cogl.set_source_color(color) cogl.path_round_rectangle(3, 3, w - 3, h - 3, 3, 10) cogl.path_fill() clutter.Group.do_paint(self)
def do_paint(self): """paint signal handler.""" w, h = self.get_size() color = self.trace.color dark_color = color.darken() cogl.set_source_color(dark_color) cogl.path_round_rectangle(0, 0, w, h, 5, 10) cogl.path_fill() cogl.set_source_color(color) cogl.path_round_rectangle(3, 3, w - 3, h - 3, 3, 10) cogl.path_fill() clutter.Group.do_paint(self)
def pick_self(self, color): if self.should_pick_paint() == False: return cogl.path_round_rectangle(0, 0, self._width, self._height, self._arc, self._step) cogl.path_close() # Start the clip cogl.clip_push_from_path() # set color to border color cogl.set_source_color(color) # draw the rectangle for the border which is the same size and the # object cogl.path_round_rectangle(0, 0, self._width, self._height, self._arc, self._step) cogl.path_close() cogl.path_fill() cogl.clip_pop()
def do_pick(self, color): if self.should_pick_paint() == False: return #return cogl.path_round_rectangle(0, 0, self._width, self._height, self._arc, self._step) cogl.path_close() # Start the clip cogl.clip_push_from_path() # set color to border color cogl.set_source_color(color) # draw the rectangle for the border which is the same size and the # object cogl.path_round_rectangle(0, 0, self._width, self._height, self._arc, self._step) cogl.path_close() cogl.path_fill() cogl.clip_pop()