summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-24 23:40:30 +0100
committerRobin Gareus <robin@gareus.org>2017-02-24 23:41:22 +0100
commit6bb2416df7ea4519add458f8a560a4c65d54ee1c (patch)
tree207a06e355f49f9d61297d2eab389ad675b5cfea /scripts
parent4afa3aa65eef48f9ccfdaa2e3b18d5e260ee1e4a (diff)
Add some Lua-script icon.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/select_every_2nd_region.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/select_every_2nd_region.lua b/scripts/select_every_2nd_region.lua
index 0ffba5b826..b05efc1a46 100644
--- a/scripts/select_every_2nd_region.lua
+++ b/scripts/select_every_2nd_region.lua
@@ -40,3 +40,21 @@ function factory () return function ()
-- set/replace current selection in the editor
Editor:set_selection (sl, ArdourUI.SelectionOp.Set);
end end
+
+function icon (params) return function (ctx, width, height, fg)
+ local wh = math.min (width, height) * .5
+
+ ctx:set_line_width (1)
+ ctx:rectangle (wh * .25, wh * .75, wh * 1.5 , .5 * wh)
+ ctx:set_source_rgba (0, 0, 0, 1)
+ ctx:stroke_preserve ()
+ ctx:set_source_rgba (.9, .9, .9, 1)
+ ctx:fill ()
+
+ ctx:set_source_rgba (1, 0, 0, 1)
+ ctx:rectangle (.5 + math.ceil(wh * 0.25), .5 + math.ceil(wh * .75), math.floor(wh * .5) - 1, math.floor(.5 * wh) - 1)
+ ctx:stroke_preserve ()
+
+ ctx:rectangle (.5 + math.ceil(wh * 1.25), .5 + math.ceil(wh * .75), math.floor(wh * .5) - 1, math.floor(.5 * wh) - 1)
+ ctx:stroke_preserve ()
+end end