def expose_window_frame(self, widget, event): ''' Internal function to expose the window frame. @param widget: the window of gtk.Widget. @param event: The expose event of type gtk.gdk.Event. ''' if self.expose_frame_function: self.expose_frame_function(widget, event) elif (self.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED != gtk.gdk.WINDOW_STATE_MAXIMIZED and self.window.get_state() & gtk.gdk.WINDOW_STATE_FULLSCREEN != gtk.gdk.WINDOW_STATE_FULLSCREEN): # Init. cr = widget.window.cairo_create() rect = widget.allocation x, y, w, h = rect.x, rect.y, rect.width, rect.height draw_window_frame( cr, x, y, w, h, ui_theme.get_alpha_color("window_frame_outside_1"), ui_theme.get_alpha_color("window_frame_outside_2"), ui_theme.get_alpha_color("window_frame_outside_3"), ui_theme.get_alpha_color("window_frame_inside_1"), ui_theme.get_alpha_color("window_frame_inside_2"), )
def expose_window(self, widget, event): ''' Internal function to expose the window. @param widget: A window of type Gtk.Widget. @param event: The expose event of type gtk.gdk.Event. @return: Always return True. ''' # Init. cr = widget.window.cairo_create() rect = widget.allocation x, y, w, h = rect.x, rect.y, rect.width, rect.height # Draw background. self.draw_background(cr, rect.x, rect.y, rect.width, rect.height) # Draw skin and mask. with cairo_state(cr): if self.window.get_state( ) & gtk.gdk.WINDOW_STATE_MAXIMIZED != gtk.gdk.WINDOW_STATE_MAXIMIZED: cr.rectangle(x + 2, y, w - 4, 1) cr.rectangle(x + 1, y + 1, w - 2, 1) cr.rectangle(x, y + 2, w, h - 4) cr.rectangle(x + 2, y + h - 1, w - 4, 1) cr.rectangle(x + 1, y + h - 2, w - 2, 1) cr.clip() self.draw_skin(cr, x, y, w, h) # Draw mask. self.draw_mask(cr, x, y, w, h) # Draw window frame. if self.window.get_state( ) & gtk.gdk.WINDOW_STATE_MAXIMIZED != gtk.gdk.WINDOW_STATE_MAXIMIZED: draw_window_frame( cr, x, y, w, h, ui_theme.get_alpha_color("window_frame_outside_1"), ui_theme.get_alpha_color("window_frame_outside_2"), ui_theme.get_alpha_color("window_frame_outside_3"), ui_theme.get_alpha_color("window_frame_inside_1"), ui_theme.get_alpha_color("window_frame_inside_2"), ) # Propagate expose. propagate_expose(widget, event) return True
def expose_window_frame(self, widget, event): '''Expose window frame.''' # Init. cr = widget.window.cairo_create() rect = widget.allocation x, y, w, h = rect.x, rect.y, rect.width, rect.height draw_window_frame(cr, x, y, w, h, ui_theme.get_alpha_color("window_frame_outside_1"), ui_theme.get_alpha_color("window_frame_outside_2"), ui_theme.get_alpha_color("window_frame_outside_3"), ui_theme.get_alpha_color("window_frame_inside_1"), ui_theme.get_alpha_color("window_frame_inside_2"), )
def expose_window(self, widget, event): """ Internal function to expose the window. @param widget: A window of type Gtk.Widget. @param event: The expose event of type gtk.gdk.Event. @return: Always return True. """ # Init. cr = widget.window.cairo_create() rect = widget.allocation x, y, w, h = rect.x, rect.y, rect.width, rect.height # Clear color to transparent window. cr.set_source_rgba(*self.background_color) cr.set_operator(cairo.OPERATOR_SOURCE) cr.paint() # Draw background. with cairo_state(cr): if self.window.get_state() != gtk.gdk.WINDOW_STATE_MAXIMIZED: cr.rectangle(x + 2, y, w - 4, 1) cr.rectangle(x + 1, y + 1, w - 2, 1) cr.rectangle(x, y + 2, w, h - 4) cr.rectangle(x + 2, y + h - 1, w - 4, 1) cr.rectangle(x + 1, y + h - 2, w - 2, 1) cr.clip() skin_config.render_background(cr, self, x, y) # Draw mask. self.draw_mask(cr, x, y, w, h) # Draw window frame. if self.window.get_state() != gtk.gdk.WINDOW_STATE_MAXIMIZED: draw_window_frame(cr, x, y, w, h, ui_theme.get_alpha_color("window_frame_outside_1"), ui_theme.get_alpha_color("window_frame_outside_2"), ui_theme.get_alpha_color("window_frame_outside_3"), ui_theme.get_alpha_color("window_frame_inside_1"), ui_theme.get_alpha_color("window_frame_inside_2"), ) # Propagate expose. propagate_expose(widget, event) return True
def expose_window(self, widget, event): ''' Internal function to expose the window. @param widget: A window of type Gtk.Widget. @param event: The expose event of type gtk.gdk.Event. @return: Always return True. ''' # Init. cr = widget.window.cairo_create() rect = widget.allocation x, y, w, h = rect.x, rect.y, rect.width, rect.height # Draw background. self.draw_background(cr, rect.x, rect.y, rect.width, rect.height) # Draw skin and mask. with cairo_state(cr): if self.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED != gtk.gdk.WINDOW_STATE_MAXIMIZED: cr.rectangle(x + 2, y, w - 4, 1) cr.rectangle(x + 1, y + 1, w - 2, 1) cr.rectangle(x, y + 2, w, h - 4) cr.rectangle(x + 2, y + h - 1, w - 4, 1) cr.rectangle(x + 1, y + h - 2, w - 2, 1) cr.clip() self.draw_skin(cr, x, y, w, h) # Draw mask. self.draw_mask(cr, x, y, w, h) # Draw window frame. if self.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED != gtk.gdk.WINDOW_STATE_MAXIMIZED: draw_window_frame(cr, x, y, w, h, ui_theme.get_alpha_color("window_frame_outside_1"), ui_theme.get_alpha_color("window_frame_outside_2"), ui_theme.get_alpha_color("window_frame_outside_3"), ui_theme.get_alpha_color("window_frame_inside_1"), ui_theme.get_alpha_color("window_frame_inside_2"), ) # Propagate expose. propagate_expose(widget, event) return True
def expose_window_frame(self, widget, event): """ Internal function to expose the window frame. @param widget: the window of gtk.Widget. @param event: The expose event of type gtk.gdk.Event. """ if self.window.get_state() != gtk.gdk.WINDOW_STATE_MAXIMIZED: # Init. cr = widget.window.cairo_create() rect = widget.allocation x, y, w, h = rect.x, rect.y, rect.width, rect.height draw_window_frame(cr, x, y, w, h, ui_theme.get_alpha_color("window_frame_outside_1"), ui_theme.get_alpha_color("window_frame_outside_2"), ui_theme.get_alpha_color("window_frame_outside_3"), ui_theme.get_alpha_color("window_frame_inside_1"), ui_theme.get_alpha_color("window_frame_inside_2"), )
def expose_window(self, widget, event): '''Expose window.''' # Init. cr = widget.window.cairo_create() rect = widget.allocation x, y, w, h = rect.x, rect.y, rect.width, rect.height # Clear color to transparent window. cr.set_source_rgba(0.0, 0.0, 0.0, 0.0) cr.set_operator(cairo.OPERATOR_SOURCE) cr.paint() # Draw background. with cairo_state(cr): cr.rectangle(x + 2, y, w - 4, 1) cr.rectangle(x + 1, y + 1, w - 2, 1) cr.rectangle(x, y + 2, w, h - 4) cr.rectangle(x + 2, y + h - 1, w - 4, 1) cr.rectangle(x + 1, y + h - 2, w - 2, 1) cr.clip() skin_config.render_background(cr, self, x, y) # Draw mask. self.draw_mask(cr, x, y, w, h) # Draw window frame. draw_window_frame(cr, x, y, w, h, ui_theme.get_alpha_color("window_frame_outside_1"), ui_theme.get_alpha_color("window_frame_outside_2"), ui_theme.get_alpha_color("window_frame_outside_3"), ui_theme.get_alpha_color("window_frame_inside_1"), ui_theme.get_alpha_color("window_frame_inside_2"), ) # Propagate expose. propagate_expose(widget, event) return True