Fix password input fields colors

This commit is contained in:
Ilya Laktyushin 2021-07-15 00:13:42 +03:00
parent 776ee35c6f
commit 6b3b6ac9ab
3 changed files with 23 additions and 23 deletions

View File

@ -1014,7 +1014,7 @@ private final class TwoFactorDataInputTextNode: ASDisplayNode, UITextFieldDelega
if self.isFailed != oldValue {
UIView.transition(with: self.view, duration: 0.2, options: [.transitionCrossDissolve, .curveEaseInOut]) {
self.inputNode.textField.textColor = self.isFailed ? self.theme.list.itemDestructiveColor : self.theme.list.freePlainInputField.primaryColor
self.hideButtonNode.setImage(generateTextHiddenImage(color: self.isFailed ? self.theme.list.itemDestructiveColor : self.theme.actionSheet.inputClearButtonColor, on: !self.inputNode.textField.isSecureTextEntry), for: [])
self.hideButtonNode.setImage(generateTextHiddenImage(color: self.isFailed ? self.theme.list.itemDestructiveColor : self.theme.list.freePlainInputField.controlColor, on: !self.inputNode.textField.isSecureTextEntry), for: [])
self.backgroundNode.image = self.isFailed ? generateStretchableFilledCircleImage(diameter: 20.0, color: self.theme.list.itemDestructiveColor.withAlphaComponent(0.1)) : generateStretchableFilledCircleImage(diameter: 20.0, color: self.theme.list.freePlainInputField.backgroundColor)
} completion: { _ in
@ -1194,7 +1194,7 @@ private final class TwoFactorDataInputTextNode: ASDisplayNode, UITextFieldDelega
}
func updateTextHidden(_ value: Bool) {
self.hideButtonNode.setImage(generateTextHiddenImage(color: self.isFailed ? self.theme.list.itemDestructiveColor : self.theme.actionSheet.inputClearButtonColor, on: !value), for: [])
self.hideButtonNode.setImage(generateTextHiddenImage(color: self.isFailed ? self.theme.list.itemDestructiveColor : self.theme.list.freePlainInputField.controlColor, on: !value), for: [])
let text = self.inputNode.textField.text ?? ""
self.inputNode.textField.isSecureTextEntry = value
if value {

View File

@ -391,18 +391,18 @@ public func makeDefaultDarkPresentationTheme(extendingThemeReference: Presentati
),
controlSecondaryColor: UIColor(rgb: 0xffffff, alpha: 0.5),
freeInputField: PresentationInputFieldTheme(
backgroundColor: UIColor(rgb: 0xffffff, alpha: 0.5),
strokeColor: UIColor(rgb: 0xffffff, alpha: 0.5),
placeholderColor: UIColor(rgb: 0x4d4d4d),
backgroundColor: UIColor(rgb: 0x272728),
strokeColor: UIColor(rgb: 0x272728),
placeholderColor: UIColor(rgb: 0x98989e),
primaryColor: UIColor(rgb: 0xffffff),
controlColor: UIColor(rgb: 0x4d4d4d)
controlColor: UIColor(rgb: 0x98989e)
),
freePlainInputField: PresentationInputFieldTheme(
backgroundColor: UIColor(rgb: 0xffffff, alpha: 0.5),
strokeColor: UIColor(rgb: 0xffffff, alpha: 0.5),
placeholderColor: UIColor(rgb: 0x4d4d4d),
backgroundColor: UIColor(rgb: 0x272728),
strokeColor: UIColor(rgb: 0x272728),
placeholderColor: UIColor(rgb: 0x98989e),
primaryColor: UIColor(rgb: 0xffffff),
controlColor: UIColor(rgb: 0x4d4d4d)
controlColor: UIColor(rgb: 0x98989e)
),
mediaPlaceholderColor: UIColor(rgb: 0xffffff).mixedWith(UIColor(rgb: 0x1c1c1d), alpha: 0.9),
scrollIndicatorColor: UIColor(rgb: 0xffffff, alpha: 0.3),

View File

@ -184,12 +184,12 @@ public func customizeDefaultDarkTintedPresentationTheme(theme: PresentationTheme
),
controlSecondaryColor: mainSecondaryTextColor?.withAlphaComponent(0.5),
freeInputField: list.freeInputField.withUpdated(
backgroundColor: mainSecondaryTextColor?.withAlphaComponent(0.5),
strokeColor: mainSecondaryTextColor?.withAlphaComponent(0.5)
backgroundColor: accentColor?.withMultiplied(hue: 1.029, saturation: 0.609, brightness: 0.12),
strokeColor: accentColor?.withMultiplied(hue: 1.029, saturation: 0.609, brightness: 0.12)
),
freePlainInputField: list.freePlainInputField.withUpdated(
backgroundColor: mainSecondaryTextColor?.withAlphaComponent(0.5),
strokeColor: mainSecondaryTextColor?.withAlphaComponent(0.5)
backgroundColor: accentColor?.withMultiplied(hue: 1.029, saturation: 0.609, brightness: 0.12),
strokeColor: accentColor?.withMultiplied(hue: 1.029, saturation: 0.609, brightness: 0.12)
),
mediaPlaceholderColor: UIColor(rgb: 0xffffff).mixedWith(mainBackgroundColor ?? list.itemBlocksBackgroundColor, alpha: 0.9),
pageIndicatorInactiveColor: mainSecondaryTextColor?.withAlphaComponent(0.4),
@ -634,18 +634,18 @@ public func makeDefaultDarkTintedPresentationTheme(extendingThemeReference: Pres
),
controlSecondaryColor: mainSecondaryTextColor.withAlphaComponent(0.5),
freeInputField: PresentationInputFieldTheme(
backgroundColor: mainSecondaryTextColor.withAlphaComponent(0.5),
strokeColor: mainSecondaryTextColor.withAlphaComponent(0.5),
placeholderColor: UIColor(rgb: 0x4d4d4d),
backgroundColor: accentColor.withMultiplied(hue: 1.029, saturation: 0.609, brightness: 0.12),
strokeColor: accentColor.withMultiplied(hue: 1.029, saturation: 0.609, brightness: 0.12),
placeholderColor: mainSecondaryTextColor.withAlphaComponent(0.5),
primaryColor: .white,
controlColor: UIColor(rgb: 0x4d4d4d)
controlColor: mainSecondaryTextColor.withAlphaComponent(0.5)
),
freePlainInputField: PresentationInputFieldTheme(
backgroundColor: mainSecondaryTextColor.withAlphaComponent(0.5),
strokeColor: mainSecondaryTextColor.withAlphaComponent(0.5),
placeholderColor: UIColor(rgb: 0x4d4d4d),
backgroundColor: accentColor.withMultiplied(hue: 1.029, saturation: 0.609, brightness: 0.12),
strokeColor: accentColor.withMultiplied(hue: 1.029, saturation: 0.609, brightness: 0.12),
placeholderColor: mainSecondaryTextColor.withAlphaComponent(0.5),
primaryColor: .white,
controlColor: UIColor(rgb: 0x4d4d4d)
controlColor: mainSecondaryTextColor.withAlphaComponent(0.5)
),
mediaPlaceholderColor: UIColor(rgb: 0xffffff).mixedWith(mainBackgroundColor, alpha: 0.9),
scrollIndicatorColor: UIColor(white: 1.0, alpha: 0.3),
@ -685,7 +685,7 @@ public func makeDefaultDarkTintedPresentationTheme(extendingThemeReference: Pres
unreadBadgeInactiveBackgroundColor: mainSecondaryTextColor.withAlphaComponent(0.4),
unreadBadgeInactiveTextColor: additionalBackgroundColor,
pinnedBadgeColor: mainSecondaryTextColor.withAlphaComponent(0.5),
pinnedSearchBarColor: mainInputColor,
pinnedSearchBarColor: accentColor.withMultiplied(hue: 1.029, saturation: 0.609, brightness: 0.12),
regularSearchBarColor: accentColor.withMultiplied(hue: 1.029, saturation: 0.609, brightness: 0.12),
sectionHeaderFillColor: mainBackgroundColor,
sectionHeaderTextColor: mainSecondaryTextColor.withAlphaComponent(0.5),