From 7b411c3ea95de553a12a94311e5e539e985eeedd Mon Sep 17 00:00:00 2001 From: jgmdev Date: Wed, 22 Jun 2022 00:42:26 -0400 Subject: [PATCH] treeview: restore ability to disable toolbarview --- data/plugins/treeview.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/data/plugins/treeview.lua b/data/plugins/treeview.lua index cc13ec59..133fe9af 100644 --- a/data/plugins/treeview.lua +++ b/data/plugins/treeview.lua @@ -854,8 +854,10 @@ config.plugins.treeview.config_spec = { description = "Default treeview width.", path = "size", type = "number", - default = math.ceil(toolbar_view:get_min_width() / SCALE), - min = toolbar_view:get_min_width() / SCALE, + default = toolbar_view and math.ceil(toolbar_view:get_min_width() / SCALE) + or 200, + min = toolbar_view and toolbar_view:get_min_width() / SCALE + or 200, get_value = function(value) return value / SCALE end, @@ -863,7 +865,9 @@ config.plugins.treeview.config_spec = { return value * SCALE end, on_apply = function(value) - view:set_target_size("x", math.max(value, toolbar_view:get_min_width())) + view:set_target_size("x", math.max( + value, toolbar_view and toolbar_view:get_min_width() or 200 + )) end }, {