forked from zelo72/mastodon-ios
fix: setting scene background color not elevated under Dark Mode issue
This commit is contained in:
parent
c4e38e76ee
commit
0b77c19857
|
@ -94,7 +94,7 @@ class SettingsViewController: UIViewController, NeedsDependency {
|
||||||
tableView.translatesAutoresizingMaskIntoConstraints = false
|
tableView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
tableView.delegate = self
|
tableView.delegate = self
|
||||||
tableView.rowHeight = UITableView.automaticDimension
|
tableView.rowHeight = UITableView.automaticDimension
|
||||||
tableView.backgroundColor = Asset.Colors.Background.systemGroupedBackground.color
|
tableView.backgroundColor = .clear
|
||||||
|
|
||||||
tableView.register(SettingsAppearanceTableViewCell.self, forCellReuseIdentifier: String(describing: SettingsAppearanceTableViewCell.self))
|
tableView.register(SettingsAppearanceTableViewCell.self, forCellReuseIdentifier: String(describing: SettingsAppearanceTableViewCell.self))
|
||||||
tableView.register(SettingsToggleTableViewCell.self, forCellReuseIdentifier: String(describing: SettingsToggleTableViewCell.self))
|
tableView.register(SettingsToggleTableViewCell.self, forCellReuseIdentifier: String(describing: SettingsToggleTableViewCell.self))
|
||||||
|
@ -185,7 +185,14 @@ class SettingsViewController: UIViewController, NeedsDependency {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setupView() {
|
private func setupView() {
|
||||||
view.backgroundColor = Asset.Colors.Background.secondarySystemBackground.color
|
view.backgroundColor = UIColor(dynamicProvider: { traitCollection in
|
||||||
|
switch traitCollection.userInterfaceLevel {
|
||||||
|
case .elevated where traitCollection.userInterfaceStyle == .dark:
|
||||||
|
return Asset.Colors.Background.systemElevatedBackground.color
|
||||||
|
default:
|
||||||
|
return Asset.Colors.Background.secondarySystemBackground.color
|
||||||
|
}
|
||||||
|
})
|
||||||
setupNavigation()
|
setupNavigation()
|
||||||
|
|
||||||
view.addSubview(tableView)
|
view.addSubview(tableView)
|
||||||
|
|
|
@ -176,7 +176,7 @@ class SettingsAppearanceTableViewCell: UITableViewCell {
|
||||||
|
|
||||||
// MARK: Private methods
|
// MARK: Private methods
|
||||||
private func setupUI() {
|
private func setupUI() {
|
||||||
backgroundColor = Asset.Colors.Background.systemGroupedBackground.color
|
backgroundColor = .clear
|
||||||
selectionStyle = .none
|
selectionStyle = .none
|
||||||
contentView.addSubview(stackView)
|
contentView.addSubview(stackView)
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,8 @@ class SettingsSectionHeader: UIView {
|
||||||
init(frame: CGRect, customView: UIView? = nil) {
|
init(frame: CGRect, customView: UIView? = nil) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
|
||||||
backgroundColor = Asset.Colors.Background.systemGroupedBackground.color
|
backgroundColor = .clear
|
||||||
|
|
||||||
stackView.addArrangedSubview(titleLabel)
|
stackView.addArrangedSubview(titleLabel)
|
||||||
if let view = customView {
|
if let view = customView {
|
||||||
stackView.addArrangedSubview(view)
|
stackView.addArrangedSubview(view)
|
||||||
|
|
Loading…
Reference in New Issue