Просмотр исходного кода

Set a minimum dashboard window size at launch.

Ensure the main window opens centered at 1024x700 and cannot be resized smaller so the UI layout remains stable.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 недель назад: 3
Родитель
Сommit
357b1dbbf3
1 измененных файлов с 13 добавлено и 2 удалено
  1. 13 2
      App for Indeed/AppDelegate.swift

+ 13 - 2
App for Indeed/AppDelegate.swift

@@ -10,11 +10,22 @@ import Cocoa
10 10
 @main
11 11
 class AppDelegate: NSObject, NSApplicationDelegate {
12 12
 
13
-    
13
+    private let minimumWindowSize = NSSize(width: 1024, height: 700)
14 14
 
15 15
 
16 16
     func applicationDidFinishLaunching(_ aNotification: Notification) {
17
-        // Insert code here to initialize your application
17
+        NSApp.activate(ignoringOtherApps: true)
18
+        DispatchQueue.main.async { [weak self] in
19
+            guard
20
+                let self,
21
+                let window = NSApp.windows.first
22
+            else { return }
23
+
24
+            window.minSize = self.minimumWindowSize
25
+            window.setContentSize(self.minimumWindowSize)
26
+            window.center()
27
+            window.makeKeyAndOrderFront(nil)
28
+        }
18 29
     }
19 30
 
20 31
     func applicationWillTerminate(_ aNotification: Notification) {