Skip to content

Commit 1194b98

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 705f6bb commit 1194b98

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
@@ -250,6 +250,21 @@ local ConfigTabClass = newClass("ConfigTab", "UndoHandler", "ControlHost", "Cont
250250
control.selIndex = varData.defaultIndex
251251
end
252252
end
253+
254+
local innerShown = control.shown
255+
control.shown = function()
256+
local shown = type(innerShown) == "boolean" and innerShown or innerShown()
257+
return not shown and control.state ~= self:GetDefaultState(varData.var, type(control.state)) or shown
258+
end
259+
local innerLabel = control.label
260+
control.label = function()
261+
local shown = type(innerShown) == "boolean" and innerShown or innerShown()
262+
if not shown and control.state ~= self:GetDefaultState(varData.var, type(control.state)) then
263+
return "^1"..innerLabel
264+
end
265+
return innerLabel
266+
end
267+
253268
t_insert(self.controls, control)
254269
t_insert(lastSection.varControlList, control)
255270
end

0 commit comments

Comments
 (0)