Exemplo n.º 1
0
 def do_expose_event(self, event):
     ClientWindow.do_expose_event(self, event)
     b = self.border
     if b is None or not b.shown:
         return
     #now paint our border import gtk.gdk
     s = b.size
     ww, wh = self.window.get_size()
     borders = []
     #window is wide enough, add borders on the side:
     borders.append((0, 0, s, wh))           #left
     borders.append((ww-s, 0, s, wh))        #right
     #window is tall enough, add borders on top and bottom:
     borders.append((0, 0, ww, s))           #top
     borders.append((0, wh-s, ww, s))        #bottom
     for x, y, w, h in borders:
         if w<=0 or h<=0:
             continue
         r = gtk.gdk.Rectangle(x, y, w, h)
         rect = event.area.intersect(r)
         if rect.width==0 or rect.height==0:
             continue
         context = self.window.cairo_create()
         context.rectangle(rect)
         context.clip()
         context.set_source_rgba(self.border.red, self.border.green, self.border.blue, self.border.alpha)
         context.fill()
         context.paint()
Exemplo n.º 2
0
 def do_expose_event(self, event):
     ClientWindow.do_expose_event(self, event)
     if not self.border_shown:
         return
     #now paint our border import gtk.gdk
     s = 5
     ww, wh = self.window.get_size()
     borders = []
     if ww>s*2:
         #window is wide enough, add borders on the side:
         borders.append((0, 0, s, wh))           #left
         borders.append((ww-s, 0, s, wh))        #right
     if wh>s*2:
         #window is tall enough, add borders on top and bottom:
         borders.append((0, 0, ww, s))           #top
         borders.append((0, wh-s, ww, s))        #bottom
     for x, y, w, h in borders:
         if w<=0 or h<=0:
             continue
         r = gtk.gdk.Rectangle(x, y, w, h)
         rect = event.area.intersect(r)
         if rect.width==0 or rect.height==0:
             continue
         context = self.window.cairo_create()
         context.rectangle(rect)
         context.clip()
         context.set_source_rgba(1.0, 0.0, 0.0, 0.5)
         context.fill()
         context.paint()
Exemplo n.º 3
0
 def do_expose_event(self, event):
     ClientWindow.do_expose_event(self, event)
     if self.border is None or not self.border.shown:
         return
     #now paint our border import gtk.gdk
     s = self.border.size
     ww, wh = self.window.get_size()
     borders = []
     #window is wide enough, add borders on the side:
     borders.append((0, 0, s, wh))  #left
     borders.append((ww - s, 0, s, wh))  #right
     #window is tall enough, add borders on top and bottom:
     borders.append((0, 0, ww, s))  #top
     borders.append((0, wh - s, ww, s))  #bottom
     for x, y, w, h in borders:
         if w <= 0 or h <= 0:
             continue
         r = gtk.gdk.Rectangle(x, y, w, h)
         rect = event.area.intersect(r)
         if rect.width == 0 or rect.height == 0:
             continue
         context = self.window.cairo_create()
         context.rectangle(rect)
         context.clip()
         context.set_source_rgba(self.border.red, self.border.green,
                                 self.border.blue, self.border.alpha)
         context.fill()
         context.paint()
Exemplo n.º 4
0
 def do_expose_event(self, event):
     if self._has_custom_decorations and self._top_bar_box.get_visible():
         gtk.Window.do_expose_event(self, event)
     ClientWindow.do_expose_event(self, event)