blob: dc440c348df1656fe30ec092152ffc63f1a5d07c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import AppKit
// A non-activating panel: clicking it (e.g. a workspace cell) runs the action
// without stealing focus from the app you're working in.
final class BarWindow: NSPanel {
init(contentRect: NSRect) {
super.init(
contentRect: contentRect,
styleMask: [.nonactivatingPanel, .borderless],
backing: .buffered,
defer: false
)
animationBehavior = .none
backgroundColor = .clear
becomesKeyOnlyIfNeeded = true
collectionBehavior = [
.canJoinAllSpaces,
.fullScreenAuxiliary,
.fullScreenNone,
.stationary,
]
hasShadow = false
hidesOnDeactivate = false
isFloatingPanel = true
isMovable = false
isOpaque = false
isReleasedWhenClosed = false
level = .floating
}
override var canBecomeMain: Bool { false }
override var canBecomeKey: Bool { true }
}
|