Center the preferences window. Fix #769.
This commit is contained in:
parent
3447ebcec0
commit
cc7321e936
|
@ -29,7 +29,6 @@ private struct ToolbarItemIdentifier {
|
||||||
|
|
||||||
class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
|
class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
|
||||||
|
|
||||||
private let windowFrameName = "Preferences"
|
|
||||||
private let windowWidth = CGFloat(512.0) // Width is constant for all views; only the height changes
|
private let windowWidth = CGFloat(512.0) // Width is constant for all views; only the height changes
|
||||||
private var viewControllers = [String: NSViewController]()
|
private var viewControllers = [String: NSViewController]()
|
||||||
private let toolbarItemSpecs: [PreferencesToolbarItemSpec] = {
|
private let toolbarItemSpecs: [PreferencesToolbarItemSpec] = {
|
||||||
|
@ -50,8 +49,7 @@ class PreferencesWindowController : NSWindowController, NSToolbarDelegate {
|
||||||
|
|
||||||
window?.showsToolbarButton = false
|
window?.showsToolbarButton = false
|
||||||
window?.toolbar = toolbar
|
window?.toolbar = toolbar
|
||||||
|
window?.center()
|
||||||
window?.setFrameAutosaveName(NSWindow.FrameAutosaveName(windowFrameName))
|
|
||||||
|
|
||||||
switchToViewAtIndex(0)
|
switchToViewAtIndex(0)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue