summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBug Magnet <marco.nikic@mullvad.net>2024-10-22 11:52:18 +0200
committerBug Magnet <marco.nikic@mullvad.net>2024-10-22 11:52:18 +0200
commitd339daefa6784a1e734ab20bb4a7db9fc8482ec5 (patch)
tree83734f5aa243e1561b355041118dbb050ad36f7c
parent4419f464ec0b19bb2476a16056d2de7f295373d8 (diff)
parent5c290e8a42aef2972ed911007b32746069a80414 (diff)
downloadmullvadvpn-d339daefa6784a1e734ab20bb4a7db9fc8482ec5.tar.xz
mullvadvpn-d339daefa6784a1e734ab20bb4a7db9fc8482ec5.zip
Merge branch 'fix-text-color-for-disabled-button'
-rw-r--r--ios/MullvadVPN/UI appearance/UIColor+Palette.swift2
-rw-r--r--ios/MullvadVPN/Views/AppButton.swift6
-rw-r--r--ios/MullvadVPN/Views/CustomButton.swift2
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: