chain-studio/macos/Runner/MainFlutterWindow.swift
flemming-it ee4a0f6c62 fix(ui): window title Ch∆In Studio (was F∆I); de-dup federation add-satellite
- linux/macOS window chrome read 'F∆I Studio' (rename leftover) → 'Ch∆In Studio'.
- The federation page showed 'Add satellite' twice when empty (FAB + empty-state
  button); drop the empty-state button, the FAB carries the action.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-06-18 12:53:35 +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 "ChIn Studio" instead of the
// pubspec-derived "chain_studio".
self.title = "Ch∆In 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()
}
}