Use IsEnabled correctly

This commit is contained in:
Shawrkie Williams
2025-12-23 12:40:30 -05:00
parent 6784436dfe
commit a4cea4b19d
2 changed files with 4 additions and 4 deletions
@@ -12,7 +12,7 @@ internal sealed class CompactLookaheadNode : SimpleComponentNode
public readonly LabelTextNode TitleNode; public readonly LabelTextNode TitleNode;
public readonly NumericInputNode CompactLookahead = null!; public readonly NumericInputNode CompactLookahead = null!;
public unsafe CompactLookaheadNode() public CompactLookaheadNode()
{ {
GeneralSettings config = System.Config.General; GeneralSettings config = System.Config.General;
@@ -28,6 +28,7 @@ internal sealed class CompactLookaheadNode : SimpleComponentNode
Position = Position with { X = 240 }, Position = Position with { X = 240 },
Size = Size with { X = 88 }, Size = Size with { X = 88 },
IsVisible = true, IsVisible = true,
IsEnabled = config.CompactPackingEnabled,
Value = config.CompactLookahead, Value = config.CompactLookahead,
OnValueUpdate = value => OnValueUpdate = value =>
{ {
@@ -35,7 +36,6 @@ internal sealed class CompactLookaheadNode : SimpleComponentNode
System.AddonInventoryWindow.ManualInventoryRefresh(); System.AddonInventoryWindow.ManualInventoryRefresh();
} }
}; };
CompactLookahead.ComponentBase->SetEnabledState(config.CompactPackingEnabled);
CompactLookahead.AttachNode(this); CompactLookahead.AttachNode(this);
TitleNode.AddTimeline(new TimelineBuilder() TitleNode.AddTimeline(new TimelineBuilder()
@@ -11,7 +11,7 @@ internal class LayoutConfigurationNode : TabbedVerticalListNode
private readonly CheckboxNode _preferLargestFitCheckboxNode = null!; private readonly CheckboxNode _preferLargestFitCheckboxNode = null!;
private readonly CheckboxNode _useStableInsertCheckboxNode = null!; private readonly CheckboxNode _useStableInsertCheckboxNode = null!;
public unsafe LayoutConfigurationNode() public LayoutConfigurationNode()
{ {
GeneralSettings config = System.Config.General; GeneralSettings config = System.Config.General;
@@ -37,7 +37,7 @@ internal class LayoutConfigurationNode : TabbedVerticalListNode
config.CompactPackingEnabled = isChecked; config.CompactPackingEnabled = isChecked;
_preferLargestFitCheckboxNode.IsEnabled = isChecked; _preferLargestFitCheckboxNode.IsEnabled = isChecked;
_useStableInsertCheckboxNode.IsEnabled = isChecked; _useStableInsertCheckboxNode.IsEnabled = isChecked;
_compactLookaheadNode.CompactLookahead.ComponentBase->SetEnabledState(isChecked); _compactLookaheadNode.CompactLookahead.IsEnabled = isChecked;
System.AddonInventoryWindow.ManualInventoryRefresh(); System.AddonInventoryWindow.ManualInventoryRefresh();
} }
}; };