Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
35 lines
1.6 KiB
Swift
Executable File
35 lines
1.6 KiB
Swift
Executable File
import CrossSoundUI
|
|
import SwiftUI
|
|
|
|
@main
|
|
struct CrossSoundApp: App {
|
|
// The AppKit half — menu-bar item, close-hides window behavior, Dock
|
|
// reopen — lives in MacAppDelegate; it also plants the MacControlSurface
|
|
// registry slot (applicationWillFinishLaunching) that AppRoot registers
|
|
// its live services into.
|
|
@NSApplicationDelegateAdaptor(MacAppDelegate.self) private var appDelegate
|
|
|
|
var body: some Scene {
|
|
// Window, not WindowGroup: Cmd+N on a group spawns a SECOND AppRoot,
|
|
// whose second PlayerEngine/QueueController fights the first over Now
|
|
// Playing. One window is the whole app.
|
|
Window("CrossSound", id: "main") {
|
|
// CrossSoundScene, not AppRoot + a bare .rwTheme(): the scene root owns
|
|
// the user's RwAppearanceController (persisted under the "appearance"
|
|
// pref) and applies .rwTheme(appearance.value) ABOVE AppRoot, which is
|
|
// the only place it can go — AppRoot reads \.rw itself, and a view never
|
|
// sees environment its own body installs. Themes/dark-mode edits from
|
|
// anywhere in the app re-theme everything through that one modifier.
|
|
CrossSoundScene(platformName: "macOS")
|
|
.frame(minWidth: 480, minHeight: 320)
|
|
}
|
|
// No title text, transparent title bar: the app draws its own bar
|
|
// (RedWhiteUI's rwTitleBar, in AppShell). It has to be said HERE, at the
|
|
// scene: rwTitleBar sets the same on the NSWindow, but SwiftUI puts the
|
|
// title back the first time a page is pushed (measured: hidden at the
|
|
// root, "CrossSound" visible again after one push) unless the scene asks
|
|
// for it too.
|
|
.windowStyle(.hiddenTitleBar)
|
|
}
|
|
}
|