From 54deff18687cc4975f9dda1b9ea02b8be5ec2526 Mon Sep 17 00:00:00 2001 From: Jaime Aranaz Date: Wed, 16 Aug 2023 16:07:11 +0200 Subject: [PATCH] fix(Checkbox): set color for filling and rounded border --- .../Components/Checkbox/Checkbox.swift | 11 ++++++----- .../CheckboxTests/testUnselectedCheckbox.1.png | Bin 779 -> 766 bytes 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Sources/MisticaSwiftUI/Components/Checkbox/Checkbox.swift b/Sources/MisticaSwiftUI/Components/Checkbox/Checkbox.swift index e357d9b4..d291586e 100644 --- a/Sources/MisticaSwiftUI/Components/Checkbox/Checkbox.swift +++ b/Sources/MisticaSwiftUI/Components/Checkbox/Checkbox.swift @@ -19,7 +19,8 @@ public struct Checkbox: View { public var body: some View { Rectangle() - .border(radiusStyle: .checkbox, borderColor: controlColor, lineWidth: lineWidth) + .fill(fillColor) + .border(radiusStyle: .checkbox, borderColor: borderColor, lineWidth: 1) .frame(width: 24, height: 24) .overlay(checkImage) .animation(.misticaTimingCurve, value: isSelected) @@ -28,12 +29,12 @@ public struct Checkbox: View { } } - var controlColor: Color { - isSelected ? .controlActivated : .control + var fillColor: Color { + isSelected ? .controlActivated : .background } - var lineWidth: CGFloat { - isSelected ? 24 : 1 + var borderColor: Color { + isSelected ? .controlActivated : .control } var imageScale: CGFloat { diff --git a/Tests/MisticaSwiftUITests/UI/__Snapshots__/CheckboxTests/testUnselectedCheckbox.1.png b/Tests/MisticaSwiftUITests/UI/__Snapshots__/CheckboxTests/testUnselectedCheckbox.1.png index 0cc45fb9ff2a2da95585a15db18627ad08115a1a..633f10cec7eb2e426692e6b8e53c8043c3e1623c 100644 GIT binary patch delta 543 zcmeBX`^P%rRlUZ-ki-uR3=Cg9T^vIy7~fnqT-D+r;u83Mzq_EJkco-GD}P=KBtuzLB~xy9e#y8&TCWC@!vH7;&;$Zc{{C@2wF z;d_CDrH_wkE2mWBfs2j{%p8@8)?Cr>kAb0{;s5{rUAZ@aA@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