Vaani/macos/Runner/AppDelegate.swift

24 lines
842 B
Swift
Raw Normal View History

2025-10-19 20:21:14 +08:00
import Cocoa
import FlutterMacOS
@main
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
2025-10-20 14:20:11 +08:00
override func applicationDidFinishLaunching(_ notification: Notification) {
guard let window = NSApplication.shared.windows.first else {
return
}
window.setContentSize(NSSize(width: 1280, height: 720)) //
// window.minSize = NSSize(width: 640, height: 480) //
// window?.maxSize = NSSize(width: 1200, height: 900) //
window.setFrameOrigin(NSPoint(x: 50, y: NSScreen.main?.frame.height ?? 1080 - (window.frame.height - 50)))
}
2025-10-19 20:21:14 +08:00
}