Skip to content

Commit 8e412c3

Browse files
authored
example slider mimic script for x-touch mini
1 parent 800cbee commit 8e412c3

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

‎examples/x-touch.lua‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
local dt = require "darktable"
2+
local du = require "lib/dtutils"
3+
4+
du.check_min_api_version("9.1.0", "x-touch")
5+
6+
function knob(action, element, effect, size)
7+
k = tonumber(action:sub(-1))
8+
9+
if dt.gui.action("iop/blend/tools/show and edit mask elements") ~= 0 then
10+
local s = { "opacity", "size", "feather", "hardness","rotation","curvature","compression" }
11+
which = "lib/masks/properties/" .. s[k]
12+
13+
elseif dt.gui.action("iop/colorzones", "focus") ~= 0 then
14+
local e = { "red", "orange", "yellow", "green", "aqua", "blue", "purple", "magenta" }
15+
element = e[k]
16+
which = "iop/colorzones/graph"
17+
18+
elseif dt.gui.action("iop/toneequal", "focus") ~= 0 then
19+
which ="iop/toneequal/simple/"..(k-9).." EV"
20+
21+
elseif k == 4 and dt.gui.action("iop/colorbalancergb", "focus") ~= 0 then
22+
which = "iop/colorbalancergb/contrast"
23+
24+
else
25+
local s = { "iop/exposure/exposure",
26+
"iop/filmicrgb/white relative exposure",
27+
"iop/filmicrgb/black relative exposure",
28+
"iop/filmicrgb/contrast",
29+
"iop/crop/left",
30+
"iop/crop/right",
31+
"iop/crop/top",
32+
"iop/crop/bottom" }
33+
which = s[k]
34+
end
35+
return dt.gui.action(which, element, effect, size)
36+
end
37+
38+
for k = 1,8 do
39+
dt.gui.mimic("slider", "knob ".. k, knob)
40+
end

0 commit comments

Comments
 (0)