Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormike <michael.jmontcalm@gmail.com>2009-12-06 00:38:37 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-12-06 00:38:37 (GMT)
commitf0aedd0e620a2dc749c8ae96db313ba8606ab834 (patch)
tree0ca34c93245a3a8f7471915e0714f890f8a818e6
parentec2c0c1dd0b44811673b7a3285bc97c2cd5c22a3 (diff)
Overlayer : Code review changes
-rw-r--r--tutorius/overlayer.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tutorius/overlayer.py b/tutorius/overlayer.py
index fcb6974..7a1b18a 100644
--- a/tutorius/overlayer.py
+++ b/tutorius/overlayer.py
@@ -20,6 +20,7 @@ drawing management (Overlayer) and basic overlayable widgets are defined here.
import gobject
import gtk
+from gtk.gdk import screen_width, screen_height
import cairo
import pangocairo
from math import pi
@@ -157,7 +158,8 @@ class Overlayer(gtk.Layout):
# Since widget is laid out in a Layout box, the Layout will honor the
# requested size. Using size_allocate could make a nasty nested loop in
# some cases.
- self._overlayed.set_size_request(allocation.width, allocation.height)
+ if self._overlayed:
+ self._overlayed.set_size_request(allocation.width, allocation.height)
class FrameOverlayer(gtk.Window):
@@ -188,7 +190,7 @@ class FrameOverlayer(gtk.Window):
self.expose = self.connect("expose-event", self.apply_mask)
def apply_mask(self,*args):
- self.px = gtk.gdk.Pixmap(None, 1173, 800, 1) # source, size, colors
+ self.px = gtk.gdk.Pixmap(None, screen_width(), screen_height(), 1) # source, size, colors
self.cr = self.px.cairo_create()
self.cr.set_operator(cairo.OPERATOR_CLEAR)
self.cr.paint()
@@ -199,7 +201,7 @@ class FrameOverlayer(gtk.Window):
widget.draw_with_context(self.cr)
self.shape_combine_mask(self.px, 0, 0) # pixmap, offset
- def put(self,widget, offset_x, offset_y):
+ def put(self, widget, offset_x, offset_y):
self._widgets.append(widget)
widget.show()
self._overlayer.put(widget, offset_x, offset_y)