Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-01-28 13:36:56 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-04-23 13:35:16 (GMT)
commit9e0a7e8a7a9a749ee63b157606d0d9ab51952557 (patch)
tree705e9352835d5f34fba6e031c13c65289a93956c
parentd5c8199152031c2ae1d09c38a823d083e48b0791 (diff)
Draw instruments in the Picker using the right border shapes
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--Jam/Picker.py32
1 files changed, 10 insertions, 22 deletions
diff --git a/Jam/Picker.py b/Jam/Picker.py
index 3b208da..e607cac 100644
--- a/Jam/Picker.py
+++ b/Jam/Picker.py
@@ -149,26 +149,19 @@ class Instrument( Picker ):
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
ctx = cairo.Context(surface)
- # draw bg
+ ctx.save()
+ ctx.set_line_width(3)
ctx.set_source_rgb(*CairoUtil.gdk_color_to_cairo(
- self.colors["Picker_Bg"]))
- ctx.rectangle(0, 0, width, height)
+ self.colors["Bg_Inactive"]))
+ CairoUtil.draw_round_rect(ctx, 0, 0, width, width)
ctx.fill_preserve()
- # TODO gtk3 no masks yet
- #self.gc.set_clip_mask( self.blockMask )
-
- # draw border
-
- # TODO gtk3 mask
- #self.gc.set_clip_origin( -Block.Instrument.MASK_START, 0 )
ctx.set_source_rgb(*CairoUtil.gdk_color_to_cairo(
self.colors["Border_Inactive"]))
- ctx.rectangle(0, 0, width, height)
ctx.stroke()
+ ctx.restore()
# draw block
- #self.gc.set_clip_origin( -Block.Instrument.MASK_START, -height )
ctx.set_source_surface(self.owner.getInstrumentImage(data["id"]), 0, 0)
ctx.paint()
@@ -230,24 +223,19 @@ class Drum( Picker ):
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
ctx = cairo.Context(surface)
-
- # draw bg
+ ctx.save()
+ ctx.set_line_width(3)
ctx.set_source_rgb(*CairoUtil.gdk_color_to_cairo(
- self.colors["Picker_Bg"]))
- ctx.rectangle(0, 0, width, height)
+ self.colors["Bg_Inactive"]))
+ CairoUtil.draw_drum_mask(ctx, 0, 0, width)
ctx.fill_preserve()
- # TODO gtk3 masaks pending
- #self.gc.set_clip_mask( self.blockMask )
-
- # draw border
ctx.set_source_rgb(*CairoUtil.gdk_color_to_cairo(
self.colors["Border_Inactive"]))
- ctx.rectangle(0, 0, width, height)
ctx.stroke()
+ ctx.restore()
# draw block
- #self.gc.set_clip_origin( -Block.Drum.MASK_START, -height )
ctx.set_source_surface(self.owner.getInstrumentImage(data["id"]), 0, 0)
ctx.paint()