Give detail URL status bar a dark background color when in dark mode.

This commit is contained in:
Brent Simmons 2018-09-10 23:03:24 -07:00
parent 25ff76e1e5
commit 3243c8dd4d
1 changed files with 7 additions and 6 deletions

View File

@ -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() {