IME // Simplify isDarkMode().
This commit is contained in:
parent
80904cd36e
commit
5e0f96aaee
|
@ -106,17 +106,9 @@ public enum IME {
|
||||||
if #available(macOS 10.15, *) {
|
if #available(macOS 10.15, *) {
|
||||||
let appearanceDescription = NSApplication.shared.effectiveAppearance.debugDescription
|
let appearanceDescription = NSApplication.shared.effectiveAppearance.debugDescription
|
||||||
.lowercased()
|
.lowercased()
|
||||||
if appearanceDescription.contains("dark") {
|
return appearanceDescription.contains("dark")
|
||||||
return true
|
} else if let appleInterfaceStyle = UserDefaults.standard.string(forKey: "AppleInterfaceStyle") {
|
||||||
}
|
return appleInterfaceStyle.lowercased().contains("dark")
|
||||||
} else if #available(macOS 10.14, *) {
|
|
||||||
if let appleInterfaceStyle = UserDefaults.standard.object(forKey: "AppleInterfaceStyle")
|
|
||||||
as? String
|
|
||||||
{
|
|
||||||
if appleInterfaceStyle.lowercased().contains("dark") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue