Files
swiftapp/swift/Sources/App/SocialIOApp.swift
T

39 lines
911 B
Swift
Raw Normal View History

2026-04-17 20:46:27 +02:00
import SwiftUI
@main
struct SocialIOApp: App {
@State private var model = AppViewModel()
2026-04-19 16:26:38 +02:00
@AppStorage("sio.theme") private var themeRawValue = ThemePreference.system.rawValue
2026-04-17 20:46:27 +02:00
var body: some Scene {
2026-04-19 16:26:38 +02:00
#if os(macOS)
2026-04-17 20:46:27 +02:00
WindowGroup {
2026-04-19 16:26:38 +02:00
rootView
2026-04-17 20:46:27 +02:00
}
.defaultSize(width: 1440, height: 900)
2026-04-19 16:26:38 +02:00
Settings {
AppearanceSettingsView()
.frame(width: 420, height: 300)
}
#else
WindowGroup {
rootView
}
2026-04-17 20:46:27 +02:00
#endif
}
2026-04-19 16:26:38 +02:00
private var themePreference: ThemePreference {
ThemePreference(rawValue: themeRawValue) ?? .system
}
private var rootView: some View {
MailRootView(model: model)
.tint(SIO.tint)
.preferredColorScheme(themePreference.colorScheme)
.onOpenURL { url in
model.apply(url: url)
}
}
2026-04-17 20:46:27 +02:00
}