From a0a8a61d56c6cd35ccc4cbee2ab280ff3ac1666a Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Sun, 16 Aug 2020 15:52:57 -0400 Subject: [PATCH 1/2] Enabled latest dev changes in lua API so that script_manager responds better to panel resizing --- tools/script_manager.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index b0532e7..5c121a7 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -65,6 +65,7 @@ local CS = dt.configuration.running_os == "windows" and "&" or ";" local LUA_DIR = dt.configuration.config_dir .. PS .. "lua" local LUA_SCRIPT_REPO = "https://github.com/darktable-org/lua-scripts.git" +local CURR_API_VERSION = dt.configuration.api_version_string dt.print_log("LUA_DIR is " .. LUA_DIR) @@ -284,7 +285,7 @@ local function deactivate(script, scriptname) end local function create_enable_disable_button(btext, sname, req) - return dt.new_widget("button") + button = dt.new_widget("button") { label = btext .. sname, tooltip = get_script_doc(req), @@ -310,6 +311,10 @@ local function create_enable_disable_button(btext, sname, req) end end } + if CURR_API_VERSION >= "6.0.1" then + button.ellipsize = "middle" + end + return button end local function load_script_stack() @@ -733,6 +738,12 @@ sm.main_stack = dt.new_widget("stack"){ table.unpack(sm.main_stack_items), } +if CURR_API_VERSION >= "6.0.1" then + sm.main_stack.h_size_fixed = false + sm.main_stack.v_size_fixed = false +end + + -- make a combobox for the selector sm.main_menu = dt.new_widget("combobox"){ From 650325257ba9b9b3ba9fc69b842c92dd1bba77ad Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Sun, 16 Aug 2020 15:57:41 -0400 Subject: [PATCH 2/2] made button a local variable --- tools/script_manager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/script_manager.lua b/tools/script_manager.lua index 5c121a7..ecb4999 100644 --- a/tools/script_manager.lua +++ b/tools/script_manager.lua @@ -285,7 +285,7 @@ local function deactivate(script, scriptname) end local function create_enable_disable_button(btext, sname, req) - button = dt.new_widget("button") + local button = dt.new_widget("button") { label = btext .. sname, tooltip = get_script_doc(req),