inline if didn't work. Added intermediate register_event function in transition library

This commit is contained in:
wpferguson
2021-02-10 00:18:48 -05:00
parent 2b28f021ee
commit b1498aa664
33 changed files with 139 additions and 57 deletions

View File

@@ -32,6 +32,7 @@ https://www.darktable.org/lua-api/index.html.php#darktable_new_widget
local dt = require "darktable"
local du = require "lib/dtutils"
require "lib/darktable_transition"
du.check_min_api_version("3.0.0", "moduleExample")
local CURR_API_STRING = dt.configuration.api_version_string
@@ -148,7 +149,7 @@ else
if not mE.event_registered then -- if we are not in lighttable view then register an event to signal when we might be
-- https://www.darktable.org/lua-api/index.html#darktable_register_event
dt.register_event(
CURR_API_STRING >= "6.2.1" and "mdouleExample", "view-changed" or "view-chagned" , -- we want to be informed when the view changes
"mdouleExample", "view-changed", -- we want to be informed when the view changes
function(event, old_view, new_view)
if new_view.name == "lighttable" and old_view.name == "darkroom" then -- if the view changes from darkroom to lighttable
install_module() -- register the lib