Selaa lähdekoodia

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 kuukautta sitten
vanhempi
sitoutus
357b1dbbf3
1 muutettua tiedostoa jossa 13 lisäystä ja 2 poistoa
  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) {