Skip to content

Commit 25f4921

Browse files
author
Tomas Slusny
committed
Do not hide config options that are configured without source
Instead highlight them in red to let user know its an error. Closes #4407 Closes #4468 Closes #1945 Signed-off-by: Tomas Slusny <ts6234@intl.att.com>
1 parent 33a95d0 commit 25f4921

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Classes/ConfigTab.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,21 @@ local ConfigTabClass = newClass("ConfigTab", "UndoHandler", "ControlHost", "Cont
244244
control.selIndex = varData.defaultIndex
245245
end
246246
end
247+
248+
local innerShown = control.shown
249+
control.shown = function()
250+
local shown = type(innerShown) == "boolean" and innerShown or innerShown()
251+
return not shown and control.state ~= self:GetDefaultState(varData.var, type(control.state)) or shown
252+
end
253+
local innerLabel = control.label
254+
control.label = function()
255+
local shown = type(innerShown) == "boolean" and innerShown or innerShown()
256+
if not shown and control.state ~= self:GetDefaultState(varData.var, type(control.state)) then
257+
return "^1"..innerLabel
258+
end
259+
return innerLabel
260+
end
261+
247262
t_insert(self.controls, control)
248263
t_insert(lastSection.varControlList, control)
249264
end

0 commit comments

Comments
 (0)