Center the preferences window. Fix #769.

This commit is contained in:
Brent Simmons 2019-08-23 16:22:06 -07:00
parent 3447ebcec0
commit cc7321e936
1 changed files with 1 additions and 3 deletions

View File

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