diff options
| author | Tommaso Negri <me@tommasongr.com> | 2026-07-27 16:18:34 +0200 |
|---|---|---|
| committer | Tommaso Negri <me@tommasongr.com> | 2026-07-27 16:18:34 +0200 |
| commit | 535b42a7b8304340182ca1367aa42f047eb06bff (patch) | |
| tree | 88e15512f874a00886fc7b97861feb5e92c6aaf5 /Sources/phbar/Views/BarWindow.swift | |
| parent | 6d165c74a5a6b471c155b12ab15ef833d6b2aa36 (diff) | |
| download | bar-535b42a7b8304340182ca1367aa42f047eb06bff.tar.gz bar-535b42a7b8304340182ca1367aa42f047eb06bff.zip | |
scaffold basic structure
Diffstat (limited to 'Sources/phbar/Views/BarWindow.swift')
| -rw-r--r-- | Sources/phbar/Views/BarWindow.swift | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Sources/phbar/Views/BarWindow.swift b/Sources/phbar/Views/BarWindow.swift new file mode 100644 index 0000000..83bbcc2 --- /dev/null +++ b/Sources/phbar/Views/BarWindow.swift @@ -0,0 +1,29 @@ +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], + backing: .buffered, + defer: false + ) + + isFloatingPanel = true + isOpaque = false + backgroundColor = .clear + hasShadow = false + hidesOnDeactivate = false + isReleasedWhenClosed = false + isMovable = false + becomesKeyOnlyIfNeeded = true + level = .floating + collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary, .stationary] + animationBehavior = .none + } + + override var canBecomeKey: Bool { true } + override var canBecomeMain: Bool { false } +} |
