Vaani/macos/Runner/AppDelegate.swift
2025-10-20 14:20:11 +08:00

23 lines
842 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Cocoa
import FlutterMacOS
@main
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
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)))
}
}