Use generated UIColors everywhere. (#1405)

- Fix destructive buttons in the menu.
This commit is contained in:
Doug
2023-07-26 11:21:34 +01:00
committed by GitHub
parent ed68ed1c91
commit f2ffded87e
10 changed files with 37 additions and 17 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ let package = Package(
.library(name: "DesignKit", targets: ["DesignKit"])
],
dependencies: [
.package(url: "https://github.com/vector-im/compound-ios.git", revision: "d9e119fbef20857eb790dd4aafbe16ff46011eca"),
.package(url: "https://github.com/vector-im/compound-ios.git", revision: "1f3eb60c4f87249d95addf84ce1aef22c2968763"),
.package(url: "https://github.com/vector-im/element-design-tokens.git", exact: "0.0.3"),
.package(url: "https://github.com/siteline/SwiftUI-Introspect.git", from: "0.9.0")
],
@@ -80,7 +80,7 @@ public struct ElementTextFieldStyle: TextFieldStyle {
}
/// The color of the placeholder text inside the text field.
private var placeholderColor: Color {
private var placeholderColor: UIColor {
.compound.textPlaceholder
}
@@ -134,7 +134,7 @@ public struct ElementTextFieldStyle: TextFieldStyle {
.introspect(.textField, on: .iOS(.v16)) { textField in
textField.clearButtonMode = .whileEditing
textField.attributedPlaceholder = NSAttributedString(string: textField.placeholder ?? "",
attributes: [NSAttributedString.Key.foregroundColor: UIColor(placeholderColor)])
attributes: [NSAttributedString.Key.foregroundColor: placeholderColor])
textField.accessibilityIdentifier = accessibilityIdentifier
}