diff --git a/FuelBoard/SettingsView.swift b/FuelBoard/SettingsView.swift index 23dd413..f1b04a5 100644 --- a/FuelBoard/SettingsView.swift +++ b/FuelBoard/SettingsView.swift @@ -104,51 +104,6 @@ struct SettingsView: View { var body: some View { NavigationStack { List { - Section { - Picker("Distance", selection: $distanceUnit) { - ForEach(DistanceUnit.allCases) { unit in - Text(unit.displayName).tag(unit) - } - } - .pickerStyle(.segmented) - .onChange(of: distanceUnit) { _, newValue in - FuelStore.saveDistanceUnit(newValue) - WidgetCenter.shared.reloadAllTimelines() - WatchSyncManager.shared.pushSnapshot() - } - Picker("Price display", selection: $priceDisplayStyle) { - ForEach(PriceDisplayStyle.allCases) { style in - Text(style.displayName).tag(style) - } - } - .pickerStyle(.segmented) - .onChange(of: priceDisplayStyle) { _, newValue in - FuelStore.savePriceDisplayStyle(newValue) - WidgetCenter.shared.reloadAllTimelines() - WatchSyncManager.shared.pushSnapshot() - } - } header: { - Text("Units") - } footer: { - Text("Distances and search radii across the app, widget and alerts are shown in this unit. Prices can be shown as on a station sign (129.9) or in pounds and pence (£1.29⁹/L).") - } - - Section { - Picker("Tap station", selection: $stationTapAction) { - ForEach(StationTapAction.allCases) { action in - Text(action.displayName).tag(action) - } - } - .pickerStyle(.segmented) - .onChange(of: stationTapAction) { _, newValue in - FuelStore.saveStationTapAction(newValue) - } - } header: { - Text("Tap action") - } footer: { - Text("Tapping a station either opens directions straight away or shows its details first.") - } - Section { Toggle("Best Value", isOn: fuelSavingsEnabledBinding) // The feature's own controls follow its toggle: switched @@ -202,6 +157,51 @@ struct SettingsView: View { Text("Best Value estimates fuel cost only, using UK imperial MPG, your typical purchase amount, fuel prices and Apple Maps road distances. Real-world average MPG is better than manufacturer figures; the fill-up amount is your usual purchase, not tank capacity.") } + Section { + Picker("Distance", selection: $distanceUnit) { + ForEach(DistanceUnit.allCases) { unit in + Text(unit.displayName).tag(unit) + } + } + .pickerStyle(.segmented) + .onChange(of: distanceUnit) { _, newValue in + FuelStore.saveDistanceUnit(newValue) + WidgetCenter.shared.reloadAllTimelines() + WatchSyncManager.shared.pushSnapshot() + } + Picker("Price display", selection: $priceDisplayStyle) { + ForEach(PriceDisplayStyle.allCases) { style in + Text(style.displayName).tag(style) + } + } + .pickerStyle(.segmented) + .onChange(of: priceDisplayStyle) { _, newValue in + FuelStore.savePriceDisplayStyle(newValue) + WidgetCenter.shared.reloadAllTimelines() + WatchSyncManager.shared.pushSnapshot() + } + } header: { + Text("Units") + } footer: { + Text("Distances and search radii across the app, widget and alerts are shown in this unit. Prices can be shown as on a station sign (129.9) or in pounds and pence (£1.29⁹/L).") + } + + Section { + Picker("Tap station", selection: $stationTapAction) { + ForEach(StationTapAction.allCases) { action in + Text(action.displayName).tag(action) + } + } + .pickerStyle(.segmented) + .onChange(of: stationTapAction) { _, newValue in + FuelStore.saveStationTapAction(newValue) + } + } header: { + Text("Tap action") + } footer: { + Text("Tapping a station either opens directions straight away or shows its details first.") + } + Section { Picker("Data checking", selection: $dataRefreshMode) { ForEach(DataRefreshMode.allCases) { mode in