Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/roundbox.py
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2012-08-07 23:06:25 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2012-08-07 23:06:25 (GMT)
commit24d236b3b0719d9b49486463737ad654aa15e6d9 (patch)
tree1793a6c6803921b3be9793205ae3da86a15b7ee3 /roundbox.py
parenta8c2f7b88a28f1ba5ef4c92b7fbb9cebdf565f80 (diff)
merging flavio's changes to fix gstreamer
Diffstat (limited to 'roundbox.py')
-rw-r--r--roundbox.py28
1 files changed, 12 insertions, 16 deletions
diff --git a/roundbox.py b/roundbox.py
index 76c657a..807385d 100644
--- a/roundbox.py
+++ b/roundbox.py
@@ -32,34 +32,30 @@ class RoundBox(Gtk.Box):
self._y = allocation.y
self._width = allocation.width
self._height = allocation.height
-
- def do_draw(self, context):
- rect = self.get_allocation()
- # set a clip region for the expose event
- context.rectangle(rect.x, rect.y,
- rect.width, rect.height)
- context.clip()
- self.draw(context)
- return False
-
- def draw(self, cr):
+
+ def do_draw(self, cr):
rect = self.get_allocation()
+ cr.rectangle(rect.x, rect.y, rect.width, rect.height)
+ cr.clip()
+
x = rect.x + self._BORDER_DEFAULT / 2
y = rect.y + self._BORDER_DEFAULT / 2
width = rect.width - self._BORDER_DEFAULT
height = rect.height - self._BORDER_DEFAULT
cr.move_to(x + self._radius, y)
+
cr.arc(x + width - self._radius, y + self._radius,
- self._radius, math.pi * 1.5, math.pi * 2)
+ self._radius, math.pi * 1.5, math.pi * 2)
cr.arc(x + width - self._radius, y + height - self._radius,
- self._radius, 0, math.pi * 0.5)
+ self._radius, 0, math.pi * 0.5)
cr.arc(x + self._radius, y + height - self._radius,
- self._radius, math.pi * 0.5, math.pi)
+ self._radius, math.pi * 0.5, math.pi)
cr.arc(x + self._radius, y + self._radius, self._radius,
- math.pi, math.pi * 1.5)
+ math.pi, math.pi * 1.5)
+
cr.close_path()
-
+
if self.background_color is not None:
r, g, b, __ = self.background_color.get_rgba()
cr.set_source_rgb(r, g, b)