diff options
author | Robin Gareus <robin@gareus.org> | 2017-02-17 21:03:30 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-02-17 21:03:30 +0100 |
commit | b4dd0201392c19cd4a903308da837c0a4dc68057 (patch) | |
tree | a135856279224c0a868982c1128ed7f726291298 /scripts/preare_record_example.lua | |
parent | b5b9e1d1e5d356dc61b97484c0d44d965506a6d1 (diff) |
..and another action-button icon
Diffstat (limited to 'scripts/preare_record_example.lua')
-rw-r--r-- | scripts/preare_record_example.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/preare_record_example.lua b/scripts/preare_record_example.lua index 9c3d6cc3e8..92ee8847f3 100644 --- a/scripts/preare_record_example.lua +++ b/scripts/preare_record_example.lua @@ -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 |