aboutsummaryrefslogtreecommitdiff
path: root/Sources/phbar/Views/BarWindow.swift
blob: ce6543205a53683a22851da59c4fad35c2535189 (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
import AppKit

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 }
}