mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix About panel in macOS 10.14 + Dark Mode
This commit is contained in:
parent
2e19abf024
commit
2d7b5e4b0b
@ -13,6 +13,7 @@ Change Log
|
||||
### Fixes
|
||||
|
||||
- Fix an issue in the find panel fields that carriage retturns (CR) were not drawn as line endings but conrol characters.
|
||||
- Fix an issue under macOS 10.14 that the text in the About panel was black even in the Dark Mode.
|
||||
|
||||
|
||||
|
||||
|
@ -304,6 +304,12 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
}
|
||||
#endif
|
||||
|
||||
// backward compatibility for macOS 10.14 that does not support `-apple-system*` colors (macOS 10.15)
|
||||
if NSAppKitVersion.current < .macOS10_15, #available(macOS 10.14, *), NSApp.effectiveAppearance.isDark {
|
||||
html = html.replacingOccurrences(of: "<body>", with: "<body style=\"color: hsla(0,0%,100%,.85)\">")
|
||||
html = html.replacingOccurrences(of: "<h2>", with: "<h2 style=\"color: hsla(0,0%,100%,.55)\">")
|
||||
}
|
||||
|
||||
let attrString = NSAttributedString(html: html.data(using: .utf8)!, baseURL: creditsURL, documentAttributes: nil)!
|
||||
NSApplication.shared.orderFrontStandardAboutPanel(options: [.credits: attrString])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user