diff options
| author | mojganii <mojgan.jelodar@codic.se> | 2024-10-22 11:34:28 +0200 |
|---|---|---|
| committer | mojganii <mojgan.jelodar@codic.se> | 2024-10-22 11:34:28 +0200 |
| commit | 5c290e8a42aef2972ed911007b32746069a80414 (patch) | |
| tree | 83734f5aa243e1561b355041118dbb050ad36f7c | |
| parent | 4419f464ec0b19bb2476a16056d2de7f295373d8 (diff) | |
| download | mullvadvpn-5c290e8a42aef2972ed911007b32746069a80414.tar.xz mullvadvpn-5c290e8a42aef2972ed911007b32746069a80414.zip | |
Fix text color for disabled state
| -rw-r--r-- | ios/MullvadVPN/UI appearance/UIColor+Palette.swift | 2 | ||||
| -rw-r--r-- | ios/MullvadVPN/Views/AppButton.swift | 6 | ||||
| -rw-r--r-- | ios/MullvadVPN/Views/CustomButton.swift | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/ios/MullvadVPN/UI appearance/UIColor+Palette.swift b/ios/MullvadVPN/UI appearance/UIColor+Palette.swift index 38749d6706..9d5cfe84bc 100644 --- a/ios/MullvadVPN/UI appearance/UIColor+Palette.swift +++ b/ios/MullvadVPN/UI appearance/UIColor+Palette.swift @@ -50,7 +50,7 @@ extension UIColor { enum AppButton { static let normalTitleColor = UIColor.white static let highlightedTitleColor = UIColor.lightGray - static let disabledTitleColor = UIColor.lightGray + static let disabledTitleColor = UIColor.white.withAlphaComponent(0.2) } enum Switch { diff --git a/ios/MullvadVPN/Views/AppButton.swift b/ios/MullvadVPN/Views/AppButton.swift index 022bd97b13..a5c092d4db 100644 --- a/ios/MullvadVPN/Views/AppButton.swift +++ b/ios/MullvadVPN/Views/AppButton.swift @@ -113,15 +113,15 @@ class AppButton: CustomButton { config.background.image = style.backgroundImage config.background.imageContentMode = .scaleAspectFill config.titleTextAttributesTransformer = - UIConfigurationTextAttributesTransformer { attributeContainer in + UIConfigurationTextAttributesTransformer { [weak self] attributeContainer in var updatedAttributeContainer = attributeContainer updatedAttributeContainer.font = UIFont.systemFont(ofSize: 18, weight: .semibold) + updatedAttributeContainer.foregroundColor = self?.state.customButtonTitleColor return updatedAttributeContainer } - let configurationHandler: UIButton.ConfigurationUpdateHandler = { [weak self] button in + let configurationHandler: UIButton.ConfigurationUpdateHandler = { [weak self] _ in guard let self else { return } - button.configuration?.baseForegroundColor = button.state.customButtonTitleColor updateButtonBackground() } configuration = config diff --git a/ios/MullvadVPN/Views/CustomButton.swift b/ios/MullvadVPN/Views/CustomButton.swift index a956025f28..8c99ddb2cc 100644 --- a/ios/MullvadVPN/Views/CustomButton.swift +++ b/ios/MullvadVPN/Views/CustomButton.swift @@ -14,7 +14,7 @@ extension UIControl.State { case .normal: return UIColor.AppButton.normalTitleColor case .disabled: - return UIColor.AppButton.disabledTitleColor.withAlphaComponent(0.5) + return UIColor.AppButton.disabledTitleColor case .highlighted: return UIColor.AppButton.highlightedTitleColor default: |
