cocoa-cb: fix building with SDK 10.12 and earlier

the NSWindowButton enum was moved to be a member of NSWindow and renamed
to ButtonType in SDK 10.13. apparently that wasn't documented anywhere.
not even in the SDK changes Document and the official Documentations
makes it look like it was always like this. the old NSWindowButton enum
though is still around on SDK 10.13 or at least got a typealias. so we
will just use that.
This commit is contained in:
Akemi 2018-03-01 20:21:14 +01:00 committed by Stefano Pigozzi
parent 7ee01860d9
commit 3263f47d33
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ class Window: NSWindow, NSWindowDelegate {
get { return NSWindow.frameRect(forContentRect: CGRect.zero, styleMask: .titled).size.height }
}
var titleButtons: [NSButton] {
get { return ([.closeButton, .miniaturizeButton, .zoomButton] as [NSWindow.ButtonType]).flatMap { standardWindowButton($0) } }
get { return ([.closeButton, .miniaturizeButton, .zoomButton] as [NSWindowButton]).flatMap { standardWindowButton($0) } }
}
override var canBecomeKey: Bool { return true }