IOS-113 fix general vqa issues (#986)
This commit is contained in:
parent
68ba70285b
commit
8f327d4c05
|
@ -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
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}()
|
||||
|
||||
|
|
Loading…
Reference in New Issue