// // ZyquoAtlasApp.swift // Zyquo Atlas // // Author: Simon-Pierre Boucher // Mail: contact@spboucher.ai // // The SwiftUI @main scene: the main browser WindowGroup, a private-window // scene (⌘⇧N), and the app menu/keyboard commands (AtlasCommands). Shared // services (catalog, vault, bookmarks, history) and the ThemeEngine are // injected into every window. // import SwiftUI import AppKit struct ZyquoAtlasApp: App { @NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate @StateObject private var appEnvironment = AppEnvironment() @StateObject private var themeEngine = ThemeEngine() var body: some Scene { WindowGroup("Zyquo Atlas") { BrowserWindowView(profile: .defaultProfile) .environmentObject(appEnvironment) .environmentObject(themeEngine) .preferredColorScheme(themeEngine.theme.colorScheme) } .windowStyle(.hiddenTitleBar) .windowToolbarStyle(.unified) .commands { AtlasCommands() } WindowGroup("Private", id: "private") { BrowserWindowView(profile: .privateProfile) .environmentObject(appEnvironment) .environmentObject(themeEngine) .preferredColorScheme(.dark) } .windowStyle(.hiddenTitleBar) .windowToolbarStyle(.unified) } } /// Ensures a terminal-launched (non-bundle) process activates and shows its /// window as a regular app rather than a background agent. final class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ notification: Notification) { NSApp.setActivationPolicy(.regular) NSApp.activate(ignoringOtherApps: true) } func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { true } }