Skip to content

Commit

Permalink
Fix text color for disabled state
Browse files Browse the repository at this point in the history
  • Loading branch information
mojganii committed Oct 22, 2024
1 parent 4419f46 commit 5c290e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ios/MullvadVPN/UI appearance/UIColor+Palette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions ios/MullvadVPN/Views/AppButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadVPN/Views/CustomButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5c290e8

Please sign in to comment.