From 1c3dfca2d72525771b8d6cc1e0eaf1d2979a162a Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 25 Aug 2023 15:08:16 -0500 Subject: [PATCH] implemented isEnabled Signed-off-by: Matt Bruce --- VDS/Classes/SelectorGroupHandlerBase.swift | 9 +++++++++ VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/VDS/Classes/SelectorGroupHandlerBase.swift b/VDS/Classes/SelectorGroupHandlerBase.swift index 868276ba..5a08d9a4 100644 --- a/VDS/Classes/SelectorGroupHandlerBase.swift +++ b/VDS/Classes/SelectorGroupHandlerBase.swift @@ -37,6 +37,15 @@ open class SelectorGroupHandlerBase: Control, Changeable { } } + /// Whether this object is enabled or not + override open var isEnabled: Bool { + didSet { + selectorViews.forEach { handler in + handler.isEnabled = isEnabled + } + } + } + /// Current Surface and this is used to pass down to child objects that implement Surfacable. override open var surface: Surface { didSet { diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 836ba6da..61035c31 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -103,6 +103,15 @@ open class ButtonGroup: View, UICollectionViewDataSource, UICollectionViewDelega } } + override open var isEnabled: Bool { + didSet { + buttons.forEach { button in + var b = button + b.isEnabled = isEnabled + } + } + } + /// Current Surface and this is used to pass down to child objects that implement Surfacable override open var surface: Surface { didSet {