diff --git a/Tusker/Views/Status/StatusCardView.swift b/Tusker/Views/Status/StatusCardView.swift index dd354ba4..5404f7f5 100644 --- a/Tusker/Views/Status/StatusCardView.swift +++ b/Tusker/Views/Status/StatusCardView.swift @@ -98,8 +98,8 @@ class StatusCardView: UIView { hStack.spacing = 4 hStack.clipsToBounds = true hStack.layer.borderWidth = 0.5 - hStack.layer.borderColor = UIColor.lightGray.cgColor hStack.backgroundColor = inactiveBackgroundColor + updateBorderColor() addSubview(hStack) @@ -132,11 +132,24 @@ class StatusCardView: UIView { NotificationCenter.default.addObserver(self, selector: #selector(updateUIForPreferences), name: .preferencesChanged, object: nil) } + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + super.traitCollectionDidChange(previousTraitCollection) + updateBorderColor() + } + override func layoutSubviews() { super.layoutSubviews() hStack.layer.cornerRadius = 0.1 * bounds.height } + private func updateBorderColor() { + if traitCollection.userInterfaceStyle == .dark { + hStack.layer.borderColor = UIColor.darkGray.cgColor + } else { + hStack.layer.borderColor = UIColor.lightGray.cgColor + } + } + func updateUI(status: StatusMO) { guard status.id != statusID else { return