touch-bar-simulator/Touch Bar Simulator/TouchBarWindow.swift
Sindre Sorhus de1c9145d4 Rewrite the app
Fixes #11
Fixes #28
Fixes #29
2018-09-25 14:52:09 +07:00

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