From 2e6d4943a21e6b3c29f61a55fa9c6aa7e24b47ce Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 31 May 2023 14:09:53 -0500 Subject: [PATCH 1/2] updated corner radius of checkbox view Signed-off-by: Matt Bruce --- VDS/Components/Checkbox/Checkbox.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDS/Components/Checkbox/Checkbox.swift b/VDS/Components/Checkbox/Checkbox.swift index 630b97ce..897ccff9 100644 --- a/VDS/Components/Checkbox/Checkbox.swift +++ b/VDS/Components/Checkbox/Checkbox.swift @@ -347,7 +347,7 @@ open class Checkbox: Control, Errorable, Changeable { self.shapeLayer = nil } - selectorView.layer.cornerRadius = VDSFormControls.borderradius + selectorView.layer.cornerRadius = 2.0 selectorView.layer.borderWidth = VDSFormControls.widthBorder if shapeLayer == nil { From c9b667d4c58d031976f5c72f16b4e5b8ee420ff7 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 2 Jun 2023 14:52:31 -0500 Subject: [PATCH 2/2] fixed issue with color Signed-off-by: Matt Bruce --- VDS/Classes/ColorConfiguration.swift | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/VDS/Classes/ColorConfiguration.swift b/VDS/Classes/ColorConfiguration.swift index 9d902a1d..e0b3a7c1 100644 --- a/VDS/Classes/ColorConfiguration.swift +++ b/VDS/Classes/ColorConfiguration.swift @@ -111,7 +111,6 @@ public class ControlColorConfiguration: KeyColorConfigurable { public typealias KeyType = UIControl.State public typealias ObjectType = Surfaceable & UIControl public var keyColors: [KeyColorConfiguration] = [] - private var lastKeyColor: KeyColorConfiguration? public required init() { } @@ -130,26 +129,11 @@ public class ControlColorConfiguration: KeyColorConfigurable { public func getColor(_ object: any ObjectType) -> UIColor { let state = object.state let surface = object.surface - - // find the exact match - if let keyColor = keyColors.first(where: {$0.key == state }) { - lastKeyColor = keyColor - return keyColor.surfaceConfig.getColor(surface) - } else if state.contains(.disabled), let keyColor = keyColors.first(where: {$0.key == .disabled }) { - lastKeyColor = keyColor + if let keyColor = keyColors.first(where: {$0.key.isSubset(of: state) }) { return keyColor.surfaceConfig.getColor(surface) - - } else if state.contains(.highlighted), let keyColor = keyColors.first(where: {$0.key == .highlighted }) { - lastKeyColor = keyColor - return keyColor.surfaceConfig.getColor(surface) - } else { - if let lastKeyColor { - return lastKeyColor.surfaceConfig.getColor(surface) - } else { - return .clear - } + return .clear } } }