Move the isOpen property from specific window controllers to the NSWindowController extension in RSCore.

This commit is contained in:
Brent Simmons 2018-02-17 18:22:57 -08:00
parent 9d39ae2de4
commit 2325e7edbc
3 changed files with 5 additions and 8 deletions

View File

@ -32,10 +32,6 @@ final class InspectorWindowController: NSWindowController {
} }
} }
var isOpen: Bool {
return isWindowLoaded && window!.isVisible
}
private var inspectors: [InspectorViewController]! private var inspectors: [InspectorViewController]!
private var currentInspector: InspectorViewController! { private var currentInspector: InspectorViewController! {

View File

@ -16,10 +16,6 @@ private let kWindowFrameKey = "MainWindow"
class MainWindowController : NSWindowController, NSUserInterfaceValidations { class MainWindowController : NSWindowController, NSUserInterfaceValidations {
var isOpen: Bool {
return isWindowLoaded && window!.isVisible
}
// MARK: NSWindowController // MARK: NSWindowController
private let windowAutosaveName = NSWindow.FrameAutosaveName(rawValue: kWindowFrameKey) private let windowAutosaveName = NSWindow.FrameAutosaveName(rawValue: kWindowFrameKey)

View File

@ -14,4 +14,9 @@ public extension NSWindowController {
return window?.isDisplayingSheet ?? false return window?.isDisplayingSheet ?? false
} }
public var isOpen: Bool {
return isWindowLoaded && window!.isVisible
}
} }