|
| 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