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 { if self.isFailed != oldValue {
UIView.transition(with: self.view, duration: 0.2, options: [.transitionCrossDissolve, .curveEaseInOut]) { 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.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) 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 } completion: { _ in
@ -1194,7 +1194,7 @@ private final class TwoFactorDataInputTextNode: ASDisplayNode, UITextFieldDelega
} }
func updateTextHidden(_ value: Bool) { 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 ?? "" let text = self.inputNode.textField.text ?? ""
self.inputNode.textField.isSecureTextEntry = value self.inputNode.textField.isSecureTextEntry = value
if value { if value {

View File

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

View File

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