PWD-1: add border to text field style

This commit is contained in:
Markus Thielker 2025-01-21 16:03:00 +01:00
parent a4dce65275
commit 63d2c9e6eb
No known key found for this signature in database

View file

@ -11,12 +11,18 @@ struct PwdTextFieldStyle: TextFieldStyle {
@Environment(\.colorScheme) var colorScheme
private let radius: CGFloat = 12
func _body(configuration: TextField<Self._Label>) -> some View {
configuration
.padding(EdgeInsets(top: 8, leading: 8, bottom: 8, trailing: 8))
.background(colorScheme == .dark ? .black : .white)
.foregroundColor(colorScheme == .dark ? .white : .black)
.textFieldStyle(.plain)
.cornerRadius(12)
.cornerRadius(radius)
.overlay(
RoundedRectangle(cornerRadius: radius)
.stroke(.gray, lineWidth: 1)
)
}
}