Some more EditorAction icons & color API update

This commit is contained in:
Robin Gareus 2017-02-18 16:12:59 +01:00
parent 4755c703f4
commit 1ab3d33df7
5 changed files with 86 additions and 3 deletions

View file

@ -68,3 +68,12 @@ function factory () return function ()
end
end
end end
function icon (params) return function (ctx, width, height, fg)
local txt = Cairo.PangoLayout (ctx, "ArdourMono ".. math.ceil(width * .7) .. "px")
txt:set_text ("\u{2669}") -- quarter note symbol UTF8
local tw, th = txt:get_pixel_size ()
ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
ctx:move_to (.5 * (width - tw), .5 * (height - th))
txt:show_in_cairo_context (ctx)
end end