NotifierUI // Enable Windows Aero Glass FX.

This commit is contained in:
ShikiSuen 2022-03-17 11:14:51 +08:00
parent 88c5e5e41e
commit ebb86e3506
1 changed files with 8 additions and 3 deletions

View File

@ -100,10 +100,15 @@ public class NotifierController: NSWindowController, NotifierWindowDelegate {
windowRect.origin.x = screenRect.maxX - windowRect.width - 10 windowRect.origin.x = screenRect.maxX - windowRect.width - 10
windowRect.origin.y = screenRect.maxY - windowRect.height - 10 windowRect.origin.y = screenRect.maxY - windowRect.height - 10
let styleMask: NSWindow.StyleMask = [.fullSizeContentView, .titled] let styleMask: NSWindow.StyleMask = [.fullSizeContentView, .titled]
let transparentVisualEffect = NSVisualEffectView()
transparentVisualEffect.blendingMode = .behindWindow
transparentVisualEffect.state = .active
transparentVisualEffect.material = .dark
let panel = NotifierWindow(contentRect: windowRect, styleMask: styleMask, backing: .buffered, defer: false) let panel = NotifierWindow(contentRect: windowRect, styleMask: styleMask, backing: .buffered, defer: false)
panel.contentView = transparentVisualEffect
panel.isMovableByWindowBackground = true
panel.level = NSWindow.Level(Int(kCGPopUpMenuWindowLevel)) panel.level = NSWindow.Level(Int(kCGPopUpMenuWindowLevel))
panel.hasShadow = true panel.hasShadow = true
panel.backgroundColor = backgroundColor panel.backgroundColor = backgroundColor