ToolTipUI // Enable round panel corners on old systems.

This commit is contained in:
ShikiSuen 2024-04-06 17:07:13 +08:00
parent 08a54c14c1
commit 40245cf1d5
1 changed files with 6 additions and 2 deletions

View File

@ -86,8 +86,12 @@ public class TooltipUI_EarlyCocoa: NSWindowController, TooltipUIProtocol {
) )
panel.level = NSWindow.Level(Int(max(CGShieldingWindowLevel(), kCGPopUpMenuWindowLevel)) + 2) panel.level = NSWindow.Level(Int(max(CGShieldingWindowLevel(), kCGPopUpMenuWindowLevel)) + 2)
panel.hasShadow = true panel.hasShadow = true
panel.backgroundColor = NSColor.controlBackgroundColor panel.backgroundColor = .clear
panel.isOpaque = false
panel.isMovable = false panel.isMovable = false
panel.contentView?.wantsLayer = true
panel.contentView?.layer?.cornerRadius = 7
panel.contentView?.layer?.backgroundColor = NSColor.controlBackgroundColor.cgColor
messageText = NSTextField() messageText = NSTextField()
messageText.isEditable = false messageText.isEditable = false
messageText.isSelectable = false messageText.isSelectable = false
@ -187,7 +191,7 @@ public class TooltipUI_EarlyCocoa: NSWindowController, TooltipUIProtocol {
red: 0.91, green: 0.95, blue: 0.92, alpha: 1.00 red: 0.91, green: 0.95, blue: 0.92, alpha: 1.00
) )
} }
window?.backgroundColor = backgroundColor window?.contentView?.layer?.backgroundColor = backgroundColor.cgColor
messageText.backgroundColor = backgroundColor messageText.backgroundColor = backgroundColor
messageText.textColor = textColor messageText.textColor = textColor
} }