Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text color for disabled state #7040

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading