TooltipUI // Hard-code certain tooltip colors.

This commit is contained in:
ShikiSuen 2023-04-15 13:50:01 +08:00
parent 5fb420adf1
commit 72ed8b081c
1 changed files with 9 additions and 9 deletions

View File

@ -103,8 +103,12 @@ public class TooltipUI: NSWindowController {
red: 1.00, green: 0.60, blue: 0.00, alpha: 1.00 red: 1.00, green: 0.60, blue: 0.00, alpha: 1.00
) )
case .denialInsufficiency: case .denialInsufficiency:
backgroundColor = NSColor.windowBackgroundColor backgroundColor = NSColor(
textColor = NSColor.labelColor red: 0.15, green: 0.15, blue: 0.15, alpha: 1.00
)
textColor = NSColor(
red: 0.88, green: 0.88, blue: 0.88, alpha: 1.00
)
case .prompt: case .prompt:
backgroundColor = NSColor( backgroundColor = NSColor(
red: 0.09, green: 0.15, blue: 0.15, alpha: 1.00 red: 0.09, green: 0.15, blue: 0.15, alpha: 1.00
@ -114,13 +118,9 @@ public class TooltipUI: NSWindowController {
) )
} }
if !NSApplication.isDarkMode { if !NSApplication.isDarkMode {
switch state { let colorInterchange = backgroundColor
case .denialInsufficiency: break backgroundColor = textColor
default: textColor = colorInterchange
let colorInterchange = backgroundColor
backgroundColor = textColor
textColor = colorInterchange
}
} }
window?.contentView?.layer?.backgroundColor = backgroundColor.cgColor window?.contentView?.layer?.backgroundColor = backgroundColor.cgColor
messageText.textColor = textColor messageText.textColor = textColor