blob: 83751c3bb512ceb3245497dc252b3af610063b17 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
import SwiftUI
import SwiftData
@main
struct Application: App {
#if os(iOS)
private var model = Hotline(trackerClient: HotlineTrackerClient(), client: HotlineClient())
#endif
private var preferences = Prefs()
var body: some Scene {
#if os(iOS)
WindowGroup {
TrackerView()
.environment(model)
}
#elseif os(macOS)
Window("Servers", id: "servers") {
TrackerView()
.frame(minWidth: 250, minHeight: 250)
.toolbar {
ToolbarItem(placement: .navigation) {
Image("Hotline")
.resizable()
.renderingMode(.template)
.scaledToFit()
.foregroundColor(Color(hex: 0xE10000))
.frame(width: 9)
}
}
}
.defaultSize(width: 700, height: 600)
.defaultPosition(.center)
WindowGroup(for: Server.self) { $server in
if let s = server {
ServerView(server: s)
.frame(minWidth: 400, minHeight: 300)
.environment(Hotline(trackerClient: HotlineTrackerClient(), client: HotlineClient()))
.environment(preferences)
.toolbar {
ToolbarItem(placement: .navigation) {
Image(systemName: "globe.americas.fill")
.resizable()
.scaledToFit()
// .foregroundColor(.secondary)
.frame(width: 22)
// .fontWeight(.light)
// Text("")
// .font(.system(size: 22, weight: .ultraLight))
}
}
}
}
.defaultSize(width: 700, height: 800)
.defaultPosition(.center)
#if os(macOS)
Settings {
SettingsView()
.environment(preferences)
}
#endif
#endif
}
}
|