chain-studio/macos/Runner/MainFlutterWindow.swift
flemming-it 68d23ab7dd
Some checks are pending
Security / Security check (push) Waiting to run
refactor: rename app fai_studio -> chain_studio
Studio is the Ch∆In product's GUI, not a F∆I-vendor app. Rename the
Flutter package, all package: imports, and the build identity across
platforms: linux/windows CMake BINARY_NAME + project, Windows Runner.rc
fields, macOS PRODUCT_NAME / bundle id (ai.flemming.chain.chainStudio) /
.app + scheme BuildableName. Update the client-SDK + flow-editor deps to
their renamed chain_* packages (path + git URL). Company/copyright fields
now read Flemming.AI. flutter analyze: clean.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-06-16 17:48:11 +02:00

33 lines
1.2 KiB
Swift

import Cocoa
import FlutterMacOS
class MainFlutterWindow: NSWindow {
override func awakeFromNib() {
let flutterViewController = FlutterViewController()
self.contentViewController = flutterViewController
// Override the window title so the OS task switcher and
// window chrome read "FI Studio" instead of the
// pubspec-derived "chain_studio".
self.title = "F∆I Studio"
// Pick a comfortable default window size. 1440x900 is the
// effective Retina resolution of a 13" MacBook (Stefan's
// dev machine) and the smallest "modern desktop" footprint
// that comfortably fits the sidebar, content area, and a
// tooling panel side-by-side. Clamp to the active screen's
// visibleFrame so we never open larger than the display
// important for external monitors at non-Retina scales.
if let screen = NSScreen.main {
let visible = screen.visibleFrame
let targetWidth = min(CGFloat(1280), visible.width)
let targetHeight = min(CGFloat(900), visible.height)
self.setContentSize(NSSize(width: targetWidth, height: targetHeight))
self.center()
}
RegisterGeneratedPlugins(registry: flutterViewController)
super.awakeFromNib()
}
}