Reputation: 2970
I am trying to make a NSPanel
that looks like this
This is initialized like that
let panel1 = NSPanel(contentRect: frame1,
styleMask: [.borderless],
backing: .buffered,
defer: true)
The thing is, when I click anywhere on the screen outside of that panel, it disappears. Only when i click on the application icon again, it comes to foreground.
With the following implementation I am getting the panel to stick on top, but there its having a border
let panel1 = NSPanel(contentRect: frame1,
styleMask: [.borderless, .nonactivatingPanel],
backing: .buffered,
defer: true)
The border (few black pixels) looks like this but is always on top.
How can I have it borderless (like the first image) but always on top (like the 2nd image).
level = .mainMenu
collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary]
Upvotes: 0
Views: 442
Reputation: 31
I know it's been a while, but for whoever is struggling, simply add hasShadow = false
that will do the trick.
Upvotes: 3