Browse Source

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 2 tháng trước cách đây
mục cha
commit
357b1dbbf3
1 tập tin đã thay đổi với 13 bổ sung2 xóa
  1. 13 2
      App for Indeed/AppDelegate.swift

+ 13 - 2
App for Indeed/AppDelegate.swift

@@ -10,11 +10,22 @@ import Cocoa
 @main
 class AppDelegate: NSObject, NSApplicationDelegate {
 
-    
+    private let minimumWindowSize = NSSize(width: 1024, height: 700)
 
 
     func applicationDidFinishLaunching(_ aNotification: Notification) {
-        // Insert code here to initialize your application
+        NSApp.activate(ignoringOtherApps: true)
+        DispatchQueue.main.async { [weak self] in
+            guard
+                let self,
+                let window = NSApp.windows.first
+            else { return }
+
+            window.minSize = self.minimumWindowSize
+            window.setContentSize(self.minimumWindowSize)
+            window.center()
+            window.makeKeyAndOrderFront(nil)
+        }
     }
 
     func applicationWillTerminate(_ aNotification: Notification) {