def on_expose_event(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation failed_pixbuf = self.failed_dpixbuf.get_pixbuf() draw_alpha_mask(cr, rect.x, rect.y, rect.width, rect.height, "layoutLeft") pixbuf_offset_x = (rect.width - failed_pixbuf.get_width()) / 2 pixbuf_offset_y = (rect.height - failed_pixbuf.get_height()) / 2 - 50 icon_x = rect.x + pixbuf_offset_x icon_y = rect.y + pixbuf_offset_y draw_pixbuf(cr, failed_pixbuf, icon_x, icon_y) text_y = icon_y + failed_pixbuf.get_height() + self.text_padding_y text_x = icon_x + self.text_padding_x _width, _height = get_content_size(self.prompt_text) self.text_rect = gtk.gdk.Rectangle(text_x - rect.x, text_y - rect.y, rect.x + rect.width - text_x - pixbuf_offset_x, _height) if self.is_hover: text_color = self.hover_text_dcolor.get_color() else: text_color = self.normal_text_dcolor.get_color() draw_text(cr, self.prompt_text, text_x, text_y, self.text_rect.width, _height, text_color=text_color, underline=True, alignment=pango.ALIGN_CENTER) return True
def on_expose_event(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation draw_alpha_mask(cr, rect.x, rect.y, rect.width - 1, rect.height ,"layoutRight") draw_line(cr, (rect.x + 1, rect.y), (rect.x + 1, rect.y + rect.height), "#b0b0b0") return False
def on_expose_event(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation empty_pixbuf = self.empty_dpixbuf.get_pixbuf() draw_alpha_mask(cr, rect.x, rect.y, rect.width, rect.height, "layoutLeft") icon_x = rect.x + (rect.width - empty_pixbuf.get_width()) / 2 icon_y = rect.y + (rect.height - empty_pixbuf.get_height()) / 2 - 50 draw_pixbuf(cr, empty_pixbuf, icon_x, icon_y) return True
def on_expose_event(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation empty_pixbuf = self.empty_dpixbuf.get_pixbuf() draw_alpha_mask(cr, rect.x, rect.y, rect.width, rect.height, "layoutLeft") pixbuf_offset_x = (rect.width - empty_pixbuf.get_width()) / 2 pixbuf_offset_y = (rect.height - empty_pixbuf.get_height()) / 2 - 50 icon_x = rect.x + pixbuf_offset_x icon_y = rect.y + pixbuf_offset_y draw_pixbuf(cr, empty_pixbuf, icon_x, icon_y) add_pixbuf = self.add_normal_dpixbuf.get_pixbuf() if self.is_hover: text_color = self.hover_text_dcolor.get_color() add_pixbuf = self.add_hover_dpixbuf.get_pixbuf() else: text_color = self.normal_text_dcolor.get_color() _width, _height = get_content_size(self.prompt_text) text_y = icon_y + empty_pixbuf.get_height() + self.text_padding_y add_icon_x = icon_x + self.prompt_offset add_icon_y = text_y + (_height - add_pixbuf.get_height()) / 2 text_x = add_icon_x + add_pixbuf.get_width() + self.text_padding_x self.text_rect = gtk.gdk.Rectangle( text_x - rect.x, text_y - rect.y, rect.x + rect.width - text_x - pixbuf_offset_x, _height) draw_pixbuf(cr, add_pixbuf, add_icon_x, add_icon_y) draw_text(cr, self.prompt_text, text_x, text_y, self.text_rect.width, _height, text_color=text_color, underline=True, text_size=10) return True
def on_expose_event(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation empty_pixbuf = self.empty_dpixbuf.get_pixbuf() draw_alpha_mask(cr, rect.x, rect.y, rect.width, rect.height, "layoutLeft") pixbuf_offset_x = (rect.width - empty_pixbuf.get_width()) / 2 pixbuf_offset_y = (rect.height - empty_pixbuf.get_height()) / 2 - 50 icon_x = rect.x + pixbuf_offset_x icon_y = rect.y + pixbuf_offset_y draw_pixbuf(cr, empty_pixbuf, icon_x, icon_y) add_pixbuf = self.add_normal_dpixbuf.get_pixbuf() if self.is_hover: text_color = self.hover_text_dcolor.get_color() add_pixbuf = self.add_hover_dpixbuf.get_pixbuf() else: text_color = self.normal_text_dcolor.get_color() _width, _height = get_content_size(self.prompt_text) text_y = icon_y + empty_pixbuf.get_height() + self.text_padding_y add_icon_x = icon_x + self.prompt_offset add_icon_y = text_y + (_height - add_pixbuf.get_height()) / 2 text_x = add_icon_x + add_pixbuf.get_width() + self.text_padding_x self.text_rect = gtk.gdk.Rectangle(text_x - rect.x, text_y - rect.y, rect.x + rect.width - text_x - pixbuf_offset_x, _height) draw_pixbuf(cr, add_pixbuf, add_icon_x, add_icon_y) draw_text(cr, self.prompt_text, text_x, text_y, self.text_rect.width, _height, text_color=text_color, underline=True, text_size=10) return True
def draw_mask(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation start_x = rect.x + 2 start_y = rect.y + 8 for size, color_info in self.rect_left_list: draw_alpha_mask(cr, start_x, start_y, size, rect.height - 8, color_info) start_x += size if self.draw_right_mask_flag: draw_alpha_mask(cr, start_x, start_y, 140, rect.height - 8, "layoutRight") start_x += 140 last_width = rect.width - (start_x - rect.x) draw_alpha_mask(cr, start_x, start_y, last_width - 2, rect.height - 8, "layoutLast") return False
def draw_view_mask(self, cr, x, y, width, height): draw_alpha_mask(cr, x, y, width, height, "layoutMiddle")
def expose_toolbar_mask(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation draw_alpha_mask(cr, rect.x - 9, rect.y, rect.width + 18, rect.height, "lyricsMask") return False
def draw_mask(self, cr, x, y, width, height): draw_alpha_mask(cr, x, y, width, height, "layoutLeft")
def draw_bg_mask(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation draw_alpha_mask(cr, rect.x, rect.y, rect.width, rect.height, "frameLight")
def draw_category_list_mask(self, cr, x, y, width, height): draw_alpha_mask(cr, x, y, width, height, "layoutLeft")
def expose_entry_mask(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation draw_alpha_mask(cr, rect.x , rect.y, rect.width, rect.height, "toolbarEntry")
def on_radiobar_draw_mask(self, cr, x, y, w, h): draw_alpha_mask(cr, x, y, w, h ,"layoutRight")
def expose_upper_box_mask(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation draw_alpha_mask(cr, rect.x, rect.y, rect.width - 2, rect.height, "layoutLast") return False
def draw_filter_view_mask(self, cr, x, y, width, height): draw_alpha_mask(cr, x, y, width, height, "layoutLast")
def on_loginbox_expose(self, widget, event): cr = widget.window.cairo_create() rect = widget.allocation draw_alpha_mask(cr, rect.x, rect.y, rect.width, rect.height, "layoutMiddle")
def plugins_view_draw_mask(self, cr, x, y, width, height): draw_alpha_mask(cr, x, y, width, height, "layoutLeft")
def on_webcastbar_draw_mask(self, cr, x, y, w, h): draw_alpha_mask(cr, x, y, w, h, "layoutRight")
def on_radiobar_draw_mask(self, cr, x, y, w, h): draw_alpha_mask(cr, x, y, w, h, "layoutRight")
def on_sourcebar_draw_mask(self, cr, x, y, w, h): draw_alpha_mask(cr, x, y, w, h, "layoutRight") return False
def on_iconview_draw_mask(self, cr, x, y, width, height): draw_alpha_mask(cr, x, y, width, height, "layoutLast")
def on_sourcebar_draw_mask(self, cr, x, y, w, h): draw_alpha_mask(cr, x, y, w, h ,"layoutRight") return False
def draw_mask(self, cr, x, y, w, h): draw_alpha_mask(cr, x, y, w, h, "layoutRight") return False
def on_webcastbar_draw_mask(self, cr, x, y, w, h): draw_alpha_mask(cr, x, y, w, h ,"layoutRight")
def draw_mask(self, cr, x, y, w, h): draw_alpha_mask(cr, x, y, w, h ,"layoutRight") return False
def draw_treeview_mask(self, cr, x, y, width, height): draw_alpha_mask(cr, x, y, width, height, ("#FFFFFF", 0.9))