..and another action-button icon
authorRobin Gareus <robin@gareus.org>
Fri, 17 Feb 2017 20:03:30 +0000 (21:03 +0100)
committerRobin Gareus <robin@gareus.org>
Fri, 17 Feb 2017 20:03:30 +0000 (21:03 +0100)
scripts/preare_record_example.lua

index 9c3d6cc3e8a0312a8a32af973b311948782d06eb..92ee8847f34564c5f830b8f04a0105bfcb495084 100644 (file)
@@ -60,3 +60,23 @@ function factory (unused) return function()
        Session:maybe_enable_record()
 
 end end
+
+function icon (params) return function (ctx, width, height)
+       local x = width * .5
+       local y = height * .5
+       local r = math.min (x, y) * .55
+
+       ctx:arc (x, y, r, 0, 2 * math.pi)
+       ctx:set_source_rgba (9, .3, .3, 1.)
+       ctx:fill_preserve ()
+       ctx:set_source_rgba (0, 0, 0, .8)
+       ctx:set_line_width (1)
+       ctx:stroke ()
+
+       local txt = Cairo.PangoLayout (ctx, "ArdourMono ".. math.ceil(r * 1.5) .. "px")
+       txt:set_text ("P")
+       local tw, th = txt:get_pixel_size ()
+       ctx:set_source_rgba (0, 0, 0, 1.0)
+       ctx:move_to (.5 * (width - tw), .5 * (height - th))
+       txt:show_in_cairo_context (ctx)
+end end