mirror of
https://github.com/sindresorhus/touch-bar-simulator
synced 2024-12-05 01:59:09 +00:00
Show touch bar window during customization (#37)
* Show touch bar window during customization * Add extra cases to NSWindow.Level
This commit is contained in:
parent
6544744392
commit
23f7c1ca46
2 changed files with 20 additions and 0 deletions
|
@ -146,6 +146,7 @@ final class TouchBarWindow: NSPanel {
|
||||||
backing: .buffered,
|
backing: .buffered,
|
||||||
defer: false
|
defer: false
|
||||||
)
|
)
|
||||||
|
self.level = .assistiveTechHigh
|
||||||
|
|
||||||
self._setPreventsActivation(true)
|
self._setPreventsActivation(true)
|
||||||
self.isRestorable = true
|
self.isRestorable = true
|
||||||
|
|
|
@ -220,3 +220,22 @@ func pressKey(keyCode: CGKeyCode, flags: CGEventFlags = []) {
|
||||||
keyDown?.post(tap: .cghidEventTap)
|
keyDown?.post(tap: .cghidEventTap)
|
||||||
keyUp?.post(tap: .cghidEventTap)
|
keyUp?.post(tap: .cghidEventTap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension NSWindow.Level {
|
||||||
|
private static func level(for cgLevelKey: CGWindowLevelKey) -> NSWindow.Level {
|
||||||
|
return NSWindow.Level(rawValue: Int(CGWindowLevelForKey(cgLevelKey)))
|
||||||
|
}
|
||||||
|
|
||||||
|
public static let desktop = level(for: .desktopWindow)
|
||||||
|
public static let desktopIcon = level(for: .desktopIconWindow)
|
||||||
|
public static let backstopMenu = level(for: .backstopMenu)
|
||||||
|
public static let dragging = level(for: .draggingWindow)
|
||||||
|
public static let overlay = level(for: .overlayWindow)
|
||||||
|
public static let help = level(for: .helpWindow)
|
||||||
|
public static let utility = level(for: .utilityWindow)
|
||||||
|
public static let assistiveTechHigh = level(for: .assistiveTechHighWindow)
|
||||||
|
public static let cursor = level(for: .cursorWindow)
|
||||||
|
|
||||||
|
public static let minimum = level(for: .minimumWindow)
|
||||||
|
public static let maximum = level(for: .maximumWindow)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue