From 5241f936c04c5f85d03c827b0b83faa28312b433 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 24 Dec 2017 10:28:34 -0800 Subject: [PATCH] Use setPointAndSizeAdjustingForScreen for setting size and position of main window on first run. --- Evergreen/MainWindow/MainWindowController.swift | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Evergreen/MainWindow/MainWindowController.swift b/Evergreen/MainWindow/MainWindowController.swift index 67101e0f8..23abc1e58 100644 --- a/Evergreen/MainWindow/MainWindowController.swift +++ b/Evergreen/MainWindow/MainWindowController.swift @@ -38,15 +38,11 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations { window?.setFrameUsingName(windowAutosaveName, force: true) if AppDefaults.shared.isFirstRun && !MainWindowController.didPositionWindowOnFirstRun { - if let window = window, let screen = window.screen { - let width: CGFloat = 1280.0 - let height: CGFloat = 768.0 - let insetX: CGFloat = 192.0 - let insetY: CGFloat = 96.0 - - window.setContentSize(NSSize(width: width, height: height)) - window.setFrameTopLeftPoint(NSPoint(x: insetX, y: screen.visibleFrame.maxY - insetY)) - + if let window = window { + let point = NSPoint(x: 128, y: 64) + let size = NSSize(width: 1000, height: 700) + let minSize = NSSize(width: 600, height: 600) + window.setPointAndSizeAdjustingForScreen(point: point, size: size, minimumSize: minSize) MainWindowController.didPositionWindowOnFirstRun = true } }