@@ -13,16 +13,19 @@ struct ControlView: View {
|
||
| 13 | 13 |
@EnvironmentObject private var meter: Meter |
| 14 | 14 |
var compactLayout: Bool = false |
| 15 | 15 |
var availableSize: CGSize? = nil |
| 16 |
+ var showsHeader: Bool = true |
|
| 16 | 17 |
|
| 17 | 18 |
var body: some View {
|
| 18 | 19 |
VStack(alignment: .leading, spacing: 14) {
|
| 19 |
- HStack {
|
|
| 20 |
- Text("Controls")
|
|
| 21 |
- .font(.headline) |
|
| 22 |
- Spacer() |
|
| 23 |
- Text(meter.reportsCurrentScreenIndex ? "Device Screen" : "Page Controls") |
|
| 24 |
- .font(.caption.weight(.semibold)) |
|
| 25 |
- .foregroundColor(.secondary) |
|
| 20 |
+ if showsHeader {
|
|
| 21 |
+ HStack {
|
|
| 22 |
+ Text("Controls")
|
|
| 23 |
+ .font(.headline) |
|
| 24 |
+ Spacer() |
|
| 25 |
+ Text(meter.reportsCurrentScreenIndex ? "Device Screen" : "Page Controls") |
|
| 26 |
+ .font(.caption.weight(.semibold)) |
|
| 27 |
+ .foregroundColor(.secondary) |
|
| 28 |
+ } |
|
| 26 | 29 |
} |
| 27 | 30 |
|
| 28 | 31 |
if compactLayout {
|
@@ -47,6 +47,25 @@ struct MeterSettingsView: View {
|
||
| 47 | 47 |
} |
| 48 | 48 |
} |
| 49 | 49 |
|
| 50 |
+ if meter.operationalState == .dataIsAvailable {
|
|
| 51 |
+ settingsCard( |
|
| 52 |
+ title: meter.reportsCurrentScreenIndex ? "Screen Controls" : "Page Controls", |
|
| 53 |
+ tint: .indigo |
|
| 54 |
+ ) {
|
|
| 55 |
+ if meter.reportsCurrentScreenIndex {
|
|
| 56 |
+ Text("Use these controls when you want to change the screen shown on the device without crowding the main meter view.")
|
|
| 57 |
+ .font(.footnote) |
|
| 58 |
+ .foregroundColor(.secondary) |
|
| 59 |
+ } else {
|
|
| 60 |
+ Text("Use these controls when you want to switch device pages without crowding the main meter view.")
|
|
| 61 |
+ .font(.footnote) |
|
| 62 |
+ .foregroundColor(.secondary) |
|
| 63 |
+ } |
|
| 64 |
+ |
|
| 65 |
+ ControlView(showsHeader: false) |
|
| 66 |
+ } |
|
| 67 |
+ } |
|
| 68 |
+ |
|
| 50 | 69 |
if meter.operationalState == .dataIsAvailable && meter.supportsUMSettings {
|
| 51 | 70 |
settingsCard(title: "Screen Timeout", tint: .purple) {
|
| 52 | 71 |
HStack {
|
@@ -77,10 +77,6 @@ struct MeterView: View {
|
||
| 77 | 77 |
.padding(16) |
| 78 | 78 |
.meterCard(tint: meter.color, fillOpacity: 0.12, strokeOpacity: 0.20) |
| 79 | 79 |
} |
| 80 |
- |
|
| 81 |
- ControlView() |
|
| 82 |
- .padding(16) |
|
| 83 |
- .meterCard(tint: .indigo, fillOpacity: 0.12, strokeOpacity: 0.20) |
|
| 84 | 80 |
} |
| 85 | 81 |
} |
| 86 | 82 |
.padding() |
@@ -122,13 +118,6 @@ struct MeterView: View {
|
||
| 122 | 118 |
.meterCard(tint: meter.color, fillOpacity: 0.12, strokeOpacity: 0.20) |
| 123 | 119 |
} |
| 124 | 120 |
} |
| 125 |
- |
|
| 126 |
- landscapeFace {
|
|
| 127 |
- ControlView(compactLayout: true, availableSize: size) |
|
| 128 |
- .padding(16) |
|
| 129 |
- .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading) |
|
| 130 |
- .meterCard(tint: .indigo, fillOpacity: 0.12, strokeOpacity: 0.20) |
|
| 131 |
- } |
|
| 132 | 121 |
} |
| 133 | 122 |
} |
| 134 | 123 |
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .automatic)) |