From b634d2b844cdb4c024e505a6bfcff07e2ce0923c Mon Sep 17 00:00:00 2001 From: Chase Carroll Date: Tue, 6 Dec 2022 11:23:04 -0500 Subject: [PATCH] Add extra contrast on the touch views Felt like they needed to stand out just a bit more in light mode. --- .../MastodonUI/View/Window/TouchesVisibleWindow.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MastodonSDK/Sources/MastodonUI/View/Window/TouchesVisibleWindow.swift b/MastodonSDK/Sources/MastodonUI/View/Window/TouchesVisibleWindow.swift index bdde38ed0..586501f3b 100644 --- a/MastodonSDK/Sources/MastodonUI/View/Window/TouchesVisibleWindow.swift +++ b/MastodonSDK/Sources/MastodonUI/View/Window/TouchesVisibleWindow.swift @@ -10,9 +10,9 @@ import UIKit /// View that represents a single touch from the user. -fileprivate final class TouchView: UIView { +private final class TouchView: UIView { - private let blurView: UIVisualEffectView + private let blurView = UIVisualEffectView(effect: nil) override var frame: CGRect { didSet { @@ -21,9 +21,6 @@ fileprivate final class TouchView: UIView { } override init(frame: CGRect) { - let blurEffect = UIBlurEffect(style: .systemUltraThinMaterialLight) - blurView = UIVisualEffectView(effect: blurEffect) - super.init(frame: frame) backgroundColor = .clear @@ -32,6 +29,10 @@ fileprivate final class TouchView: UIView { layer.borderColor = UIColor.white.cgColor layer.borderWidth = 2.0 + let blurEffect = traitCollection.userInterfaceStyle == .light ? + UIBlurEffect(style: .systemUltraThinMaterialDark) : + UIBlurEffect(style: .systemUltraThinMaterialLight) + blurView.effect = blurEffect addSubview(blurView) }