|
|
@@ -22,6 +22,19 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|
|
window.titleVisibility = .hidden
|
|
|
window.styleMask.insert(.fullSizeContentView)
|
|
|
window.isMovableByWindowBackground = true
|
|
|
+ window.minSize = NSSize(width: 760, height: 520)
|
|
|
+
|
|
|
+ let targetContentSize = NSSize(width: 980, height: 700)
|
|
|
+ if window.contentRect(forFrameRect: window.frame).size.width < targetContentSize.width ||
|
|
|
+ window.contentRect(forFrameRect: window.frame).size.height < targetContentSize.height {
|
|
|
+ let currentCenter = NSPoint(x: window.frame.midX, y: window.frame.midY)
|
|
|
+ var targetFrame = window.frameRect(forContentRect: NSRect(origin: .zero, size: targetContentSize))
|
|
|
+ targetFrame.origin = NSPoint(
|
|
|
+ x: currentCenter.x - (targetFrame.width / 2),
|
|
|
+ y: currentCenter.y - (targetFrame.height / 2)
|
|
|
+ )
|
|
|
+ window.setFrame(targetFrame, display: true)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func applicationWillTerminate(_ aNotification: Notification) {
|