Remove 10.10 compatibility workarounds.

This commit is contained in:
Damiano Galassi committed 2019-02-26 11:28:01 +01:00
1 parent 9ad00edfe0
commit a1933a752f
6 files changed
+24 -37

No files matched your search

+14 -7
View File
@@ -33,21 +33,28 @@ import Quartz
override init(frame frameRect: NSRect) {
pasteboardTypes = Array()
super.init(frame: frameRect)
if #available(OSX 10.14, *) {
updateBackgroundColor()
}
updateBackgroundColor()
}
required init?(coder: NSCoder) {
pasteboardTypes = Array()
super.init(coder: coder)
if #available(OSX 10.14, *) {
updateBackgroundColor()
}
updateBackgroundColor()
}
override func viewDidChangeEffectiveAppearance() {
updateBackgroundColor()
}
private func updateBackgroundColor() {
setValue(NSColor.clear, forKey: IKImageBrowserBackgroundColorKey)
if #available(OSX 10.14, *) {
let dark = effectiveAppearance.bestMatch(from: [.darkAqua]) == .darkAqua ? true : false
if dark {
setValue(NSColor.clear, forKey: IKImageBrowserBackgroundColorKey)
} else {
setValue(NSColor.white, forKey: IKImageBrowserBackgroundColorKey)
}
}
}
private func implements(selector: Selector) -> Bool {