From 3243c8dd4d062ac26aa715c847d185451bf1dfa1 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 10 Sep 2018 23:03:24 -0700 Subject: [PATCH] Give detail URL status bar a dark background color when in dark mode. --- .../MainWindow/Detail/DetailStatusBarView.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/NetNewsWire/MainWindow/Detail/DetailStatusBarView.swift b/NetNewsWire/MainWindow/Detail/DetailStatusBarView.swift index b0f85397b..1a0bca4da 100644 --- a/NetNewsWire/MainWindow/Detail/DetailStatusBarView.swift +++ b/NetNewsWire/MainWindow/Detail/DetailStatusBarView.swift @@ -14,7 +14,7 @@ final class DetailStatusBarView: NSView { @IBOutlet var urlLabel: NSTextField! - private var didConfigureLayer = false + private var didConfigureLayerRadius = false private var mouseoverLink: String? { didSet { updateLinkForDisplay() @@ -49,15 +49,16 @@ final class DetailStatusBarView: NSView { override func updateLayer() { - guard !didConfigureLayer else { + guard let layer = layer else { return } - if let layer = layer { - let color = appDelegate.currentTheme.color(forKey: "MainWindow.Detail.statusBar.backgroundColor") - layer.backgroundColor = color.cgColor + if !didConfigureLayerRadius { layer.cornerRadius = 4.0 - didConfigureLayer = true + didConfigureLayerRadius = true } + + let color = self.effectiveAppearance.isDarkMode ? NSColor.textBackgroundColor : appDelegate.currentTheme.color(forKey: "MainWindow.Detail.statusBar.backgroundColor") + layer.backgroundColor = color.cgColor } override func awakeFromNib() {