mirror of
https://github.com/sindresorhus/touch-bar-simulator
synced 2025-01-22 08:45:19 +00:00
de1c9145d4
Fixes #11 Fixes #28 Fixes #29
33 lines
601 B
Swift
33 lines
601 B
Swift
import Cocoa
|
|
|
|
final class TouchBarWindow: NSPanel {
|
|
override var canBecomeMain: Bool {
|
|
return false
|
|
}
|
|
|
|
override var canBecomeKey: Bool {
|
|
return false
|
|
}
|
|
|
|
convenience init() {
|
|
self.init(
|
|
contentRect: .zero,
|
|
styleMask: [
|
|
.titled,
|
|
.closable,
|
|
.hudWindow,
|
|
.nonactivatingPanel
|
|
],
|
|
backing: .buffered,
|
|
defer: false
|
|
)
|
|
|
|
self._setPreventsActivation(true)
|
|
self.title = "Touch Bar Simulator"
|
|
self.isRestorable = true
|
|
self.hidesOnDeactivate = false
|
|
self.worksWhenModal = true
|
|
self.acceptsMouseMovedEvents = true
|
|
self.isMovableByWindowBackground = false
|
|
}
|
|
}
|