fix: content warning overlay and setting separator line not using theme color issue

This commit is contained in:
CMK 2021-07-07 17:52:06 +08:00
parent 4138b05ac9
commit 6f7acc0173
4 changed files with 21 additions and 7 deletions

View File

@ -23,9 +23,9 @@
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"alpha" : "1.000", "alpha" : "1.000",
"blue" : "0.263", "blue" : "0x6E",
"green" : "0.208", "green" : "0x57",
"red" : "0.192" "red" : "0x4F"
} }
}, },
"idiom" : "universal" "idiom" : "universal"

View File

@ -23,9 +23,9 @@
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"alpha" : "1.000", "alpha" : "1.000",
"blue" : "0.263", "blue" : "60",
"green" : "0.208", "green" : "58",
"red" : "0.192" "red" : "58"
} }
}, },
"idiom" : "universal" "idiom" : "universal"

View File

@ -236,6 +236,8 @@ class SettingsViewController: UIViewController, NeedsDependency {
return theme.secondarySystemBackgroundColor return theme.secondarySystemBackgroundColor
} }
}) })
tableView.separatorColor = theme.separator
} }
private func setupNavigation() { private func setupNavigation() {

View File

@ -17,6 +17,7 @@ protocol ContentWarningOverlayViewDelegate: AnyObject {
class ContentWarningOverlayView: UIView { class ContentWarningOverlayView: UIView {
var disposeBag = Set<AnyCancellable>() var disposeBag = Set<AnyCancellable>()
private var _disposeBag = Set<AnyCancellable>()
static let cornerRadius: CGFloat = 4 static let cornerRadius: CGFloat = 4
static let blurVisualEffect = UIBlurEffect(style: .systemUltraThinMaterial) static let blurVisualEffect = UIBlurEffect(style: .systemUltraThinMaterial)
@ -36,7 +37,6 @@ class ContentWarningOverlayView: UIView {
// for status style overlay // for status style overlay
let contentOverlayView: UIView = { let contentOverlayView: UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = ThemeService.shared.currentTheme.value.contentWarningOverlayBackgroundColor
view.applyCornerRadius(radius: ContentWarningOverlayView.cornerRadius) view.applyCornerRadius(radius: ContentWarningOverlayView.cornerRadius)
return view return view
}() }()
@ -156,6 +156,18 @@ extension ContentWarningOverlayView {
addGestureRecognizer(tapGestureRecognizer) addGestureRecognizer(tapGestureRecognizer)
configure(style: .media) configure(style: .media)
setupBackgroundColor(theme: ThemeService.shared.currentTheme.value)
ThemeService.shared.currentTheme
.receive(on: RunLoop.main)
.sink { [weak self] theme in
guard let self = self else { return }
self.setupBackgroundColor(theme: theme)
}
.store(in: &_disposeBag)
}
private func setupBackgroundColor(theme: Theme) {
contentOverlayView.backgroundColor = theme.contentWarningOverlayBackgroundColor
} }
} }