From 8f327d4c05e21f3a0d1e47a93a18bf8d0f836304 Mon Sep 17 00:00:00 2001 From: Marcus Kida Date: Tue, 21 Mar 2023 08:01:40 +0100 Subject: [PATCH] IOS-113 fix general vqa issues (#986) --- .../Cell/SettingsToggleTableViewCell.swift | 24 +++---------------- .../View/Content/NotificationView.swift | 2 ++ 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Mastodon/Scene/Settings/Cell/SettingsToggleTableViewCell.swift b/Mastodon/Scene/Settings/Cell/SettingsToggleTableViewCell.swift index 05d5ecea2..a72894188 100644 --- a/Mastodon/Scene/Settings/Cell/SettingsToggleTableViewCell.swift +++ b/Mastodon/Scene/Settings/Cell/SettingsToggleTableViewCell.swift @@ -20,6 +20,7 @@ class SettingsToggleTableViewCell: UITableViewCell { private(set) lazy var switchButton: UISwitch = { let view = UISwitch(frame:.zero) + view.onTintColor = Asset.Colors.brand.color return view }() @@ -48,15 +49,8 @@ class SettingsToggleTableViewCell: UITableViewCell { accessoryView = switchButton textLabel?.numberOfLines = 0 - updateAppearance() switchButton.addTarget(self, action: #selector(switchValueDidChange(sender:)), for: .valueChanged) } - - override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { - super.traitCollectionDidChange(previousTraitCollection) - - updateAppearance() - } } @@ -71,23 +65,11 @@ extension SettingsToggleTableViewCell { } extension SettingsToggleTableViewCell { - + func update(enabled: Bool?) { switchButton.isEnabled = enabled != nil textLabel?.textColor = enabled != nil ? Asset.Colors.Label.primary.color : Asset.Colors.Label.secondary.color switchButton.isOn = enabled ?? false } - - private func updateAppearance() { - switchButton.onTintColor = { - switch traitCollection.userInterfaceStyle { - case .dark: - // set default green for Dark Mode - return nil - default: - // set tint black for Light Mode - return self.contentView.window?.tintColor - } - }() - } + } diff --git a/MastodonSDK/Sources/MastodonUI/View/Content/NotificationView.swift b/MastodonSDK/Sources/MastodonUI/View/Content/NotificationView.swift index adb12fa0a..6bd0062e3 100644 --- a/MastodonSDK/Sources/MastodonUI/View/Content/NotificationView.swift +++ b/MastodonSDK/Sources/MastodonUI/View/Content/NotificationView.swift @@ -93,8 +93,10 @@ public final class NotificationView: UIView { public let menuButton: UIButton = { let button = HitTestExpandedButton(type: .system) + button.tintColor = Asset.Colors.Label.secondary.color let image = UIImage(systemName: "ellipsis", withConfiguration: UIImage.SymbolConfiguration(font: .systemFont(ofSize: 15))) button.setImage(image, for: .normal) + button.accessibilityLabel = L10n.Common.Controls.Status.Actions.menu return button }()