TooltipUI // Add round window corners.
* Note: This is not migratable to macOS 10.9 (plus that it is meaningless to test for macOS 10.10 - 10.12), hence the decision that this feature will be offered to the mainstream releases only.
This commit is contained in:
parent
04cb05ea34
commit
ed84c613a0
|
@ -36,10 +36,14 @@ public class TooltipUI: NSWindowController {
|
||||||
)
|
)
|
||||||
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 = NSColor.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 = NSAttributedTooltipTextView()
|
messageText = NSAttributedTooltipTextView()
|
||||||
messageText.backgroundColor = NSColor.controlBackgroundColor
|
messageText.backgroundColor = NSColor.clear
|
||||||
messageText.textColor = NSColor.textColor
|
messageText.textColor = NSColor.textColor
|
||||||
messageText.needsDisplay = true
|
messageText.needsDisplay = true
|
||||||
panel.contentView?.addSubview(messageText)
|
panel.contentView?.addSubview(messageText)
|
||||||
|
@ -118,8 +122,7 @@ public class TooltipUI: NSWindowController {
|
||||||
textColor = colorInterchange
|
textColor = colorInterchange
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window?.backgroundColor = backgroundColor
|
window?.contentView?.layer?.backgroundColor = backgroundColor.cgColor
|
||||||
messageText.backgroundColor = backgroundColor
|
|
||||||
messageText.textColor = textColor
|
messageText.textColor = textColor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue