-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolarSystemSettings.swift
More file actions
50 lines (44 loc) · 1.55 KB
/
SolarSystemSettings.swift
File metadata and controls
50 lines (44 loc) · 1.55 KB
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
/*
See the LICENSE.txt file for this sample’s licensing information.
Abstract:
Debug setting controls for the solar system module.
*/
import SwiftUI
/// Debug setting controls for the solar system module.
struct SolarSystemSettings: View {
@Environment(ViewModel.self) private var model
var body: some View {
@Bindable var model = model
VStack {
Text("Solar system module debug settings")
.font(.title)
Form {
EarthSettings(configuration: $model.solarEarth)
SatelliteSettings(configuration: $model.solarSatellite)
SatelliteSettings(configuration: $model.solarMoon)
Section("Sun") {
Grid(alignment: .leading, verticalSpacing: 20) {
SliderGridRow(
title: "Distance to Earth",
value: $model.solarSunDistance,
range: 0 ... 1e3)
}
}
Section("System") {
Grid(alignment: .leading, verticalSpacing: 20) {
Button("Reset") {
model.solarEarth = .solarEarthDefault
model.solarSatellite = .solarTelescopeDefault
model.solarMoon = .solarMoonDefault
}
}
}
}
}
}
}
#Preview {
SolarSystemSettings()
.frame(width: 500)
.environment(ViewModel())
}