-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added documentation for darktable.gui.mimic
- Loading branch information
1 parent
cd6a88c
commit b233ad4
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: darktable.gui.mimic | ||
id: action | ||
weight: 60 | ||
draft: false | ||
author: "people" | ||
--- | ||
|
||
``` | ||
function( | ||
widget_type : string, | ||
name : string, | ||
callback : function | ||
) | ||
``` | ||
|
||
Provides a virtual widget that can be assigned to a shortcut. | ||
|
||
* **widget_type** - _string_ - The type of widget to mimic, one of: button, slider, dropdown. | ||
* **name** - _string_ - The name of the virtual widget that a shortcut can be assigned to. | ||
* **callback** - _function_ - A function containing [darktable.gui.action](../gui/action.md) calls to execute. | ||
|
||
## Example | ||
|
||
``` | ||
local dt = require "darktable" | ||
dt.gui.mimic("slider", "multi-contrast", | ||
function(action, element, effect, size) | ||
if dt.gui.action("iop/filmicrgb", "focus") == 1 then | ||
which = "iop/filmicrgb/contrast" | ||
else | ||
which = "iop/colorbalancergb/contrast" | ||
end | ||
return dt.gui.action(which, element, effect, size) | ||
end | ||
) | ||
``` |