Skip to content

Commit

Permalink
fix(Checkbox): set color for filling and rounded border
Browse files Browse the repository at this point in the history
  • Loading branch information
jaranaz committed Aug 17, 2023
1 parent fe71624 commit 54deff1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Sources/MisticaSwiftUI/Components/Checkbox/Checkbox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 54deff1

Please sign in to comment.