mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 13:53:37 +00:00
[ios] Adjusted code for consistency
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Yannik Bloscheck
parent
4fd617684b
commit
93415fe952
@@ -2,7 +2,7 @@ import SwiftUI
|
||||
|
||||
/// View for the navigation settings
|
||||
struct SettingsNavigationView: View {
|
||||
// MARK: - Properties
|
||||
// MARK: Properties
|
||||
|
||||
/// If the perspective view should be used during routing
|
||||
@State var hasPerspectiveViewWhileRouting: Bool = true
|
||||
@@ -46,89 +46,87 @@ struct SettingsNavigationView: View {
|
||||
|
||||
/// The actual view
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
List {
|
||||
Section {
|
||||
Toggle("pref_map_3d_title", isOn: $hasPerspectiveViewWhileRouting)
|
||||
.tint(.accent)
|
||||
|
||||
Toggle("pref_map_auto_zoom", isOn: $hasAutoZoomWhileRouting)
|
||||
.tint(.accent)
|
||||
}
|
||||
List {
|
||||
Section {
|
||||
Toggle("pref_map_3d_title", isOn: $hasPerspectiveViewWhileRouting)
|
||||
.tint(.accent)
|
||||
|
||||
Section {
|
||||
Toggle("pref_tts_enable_title", isOn: $shouldProvideVoiceRouting)
|
||||
.tint(.accent)
|
||||
Toggle("pref_map_auto_zoom", isOn: $hasAutoZoomWhileRouting)
|
||||
.tint(.accent)
|
||||
}
|
||||
|
||||
Section {
|
||||
Toggle("pref_tts_enable_title", isOn: $shouldProvideVoiceRouting)
|
||||
.tint(.accent)
|
||||
|
||||
if shouldProvideVoiceRouting {
|
||||
Picker(selection: $selectedLanguageForVoiceRouting) {
|
||||
ForEach(Settings.availableLanguagesForVoiceRouting) { languageForVoiceRouting in
|
||||
Text(languageForVoiceRouting.localizedName)
|
||||
.tag(languageForVoiceRouting.id)
|
||||
}
|
||||
} label: {
|
||||
Text("pref_tts_language_title")
|
||||
}
|
||||
|
||||
if shouldProvideVoiceRouting {
|
||||
Picker(selection: $selectedLanguageForVoiceRouting) {
|
||||
ForEach(Settings.availableLanguagesForVoiceRouting) { languageForVoiceRouting in
|
||||
Text(languageForVoiceRouting.localizedName)
|
||||
.tag(languageForVoiceRouting.id)
|
||||
}
|
||||
} label: {
|
||||
Text("pref_tts_language_title")
|
||||
}
|
||||
|
||||
Toggle(isOn: $shouldAnnounceStreetnamesWhileVoiceRouting) {
|
||||
VStack(alignment: .leading) {
|
||||
Text("pref_tts_street_names_title")
|
||||
|
||||
Text("pref_tts_street_names_description")
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
.tint(.accent)
|
||||
|
||||
Picker(selection: $selectedAnnouncingSpeedTrapsWhileVoiceRouting) {
|
||||
ForEach(Settings.AnnouncingSpeedTrapsWhileVoiceRouting.allCases) { announcingSpeedTrapsWhileVoiceRouting in
|
||||
Text(announcingSpeedTrapsWhileVoiceRouting.description)
|
||||
}
|
||||
} label: {
|
||||
Text("speedcams_alert_title")
|
||||
Toggle(isOn: $shouldAnnounceStreetnamesWhileVoiceRouting) {
|
||||
VStack(alignment: .leading) {
|
||||
Text("pref_tts_street_names_title")
|
||||
|
||||
Text("pref_tts_street_names_description")
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
} header: {
|
||||
Text("pref_tts_title")
|
||||
} footer: {
|
||||
if shouldProvideVoiceRouting {
|
||||
Button {
|
||||
Settings.playVoiceRoutingTest()
|
||||
} label: {
|
||||
Text("pref_tts_test_voice_title")
|
||||
.bold()
|
||||
.lineLimit(1)
|
||||
.padding(4)
|
||||
.frame(maxWidth: .infinity)
|
||||
.tint(.accent)
|
||||
|
||||
Picker(selection: $selectedAnnouncingSpeedTrapsWhileVoiceRouting) {
|
||||
ForEach(Settings.AnnouncingSpeedTrapsWhileVoiceRouting.allCases) { announcingSpeedTrapsWhileVoiceRouting in
|
||||
Text(announcingSpeedTrapsWhileVoiceRouting.description)
|
||||
}
|
||||
.buttonStyle(BorderedButtonStyle())
|
||||
.foregroundStyle(.alternativeAccent)
|
||||
.padding([.top, .bottom])
|
||||
.listRowInsets(.init(top: 0, leading: 0, bottom: 0, trailing: 0))
|
||||
} label: {
|
||||
Text("speedcams_alert_title")
|
||||
}
|
||||
}
|
||||
|
||||
Section {
|
||||
Toggle("avoid_tolls", isOn: $shouldAvoidTollRoadsWhileRouting)
|
||||
.tint(.accent)
|
||||
|
||||
Toggle("avoid_unpaved", isOn: $shouldAvoidUnpavedRoadsWhileRouting)
|
||||
.tint(.accent)
|
||||
|
||||
Toggle("avoid_ferry", isOn: $shouldAvoidFerriesWhileRouting)
|
||||
.tint(.accent)
|
||||
|
||||
Toggle("avoid_motorways", isOn: $shouldAvoidMotorwaysWhileRouting)
|
||||
.tint(.accent)
|
||||
} header: {
|
||||
Text("driving_options_title")
|
||||
} header: {
|
||||
Text("pref_tts_title")
|
||||
} footer: {
|
||||
if shouldProvideVoiceRouting {
|
||||
Button {
|
||||
Settings.playVoiceRoutingTest()
|
||||
} label: {
|
||||
Text("pref_tts_test_voice_title")
|
||||
.bold()
|
||||
.lineLimit(1)
|
||||
.padding(4)
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.buttonStyle(BorderedButtonStyle())
|
||||
.foregroundStyle(.alternativeAccent)
|
||||
.padding([.top, .bottom])
|
||||
.listRowInsets(.init(top: 0, leading: 0, bottom: 0, trailing: 0))
|
||||
}
|
||||
}
|
||||
|
||||
Section {
|
||||
Toggle("avoid_tolls", isOn: $shouldAvoidTollRoadsWhileRouting)
|
||||
.tint(.accent)
|
||||
|
||||
Toggle("avoid_unpaved", isOn: $shouldAvoidUnpavedRoadsWhileRouting)
|
||||
.tint(.accent)
|
||||
|
||||
Toggle("avoid_ferry", isOn: $shouldAvoidFerriesWhileRouting)
|
||||
.tint(.accent)
|
||||
|
||||
Toggle("avoid_motorways", isOn: $shouldAvoidMotorwaysWhileRouting)
|
||||
.tint(.accent)
|
||||
} header: {
|
||||
Text("driving_options_title")
|
||||
}
|
||||
}
|
||||
.accentColor(.accent)
|
||||
.navigationViewStyle(StackNavigationViewStyle())
|
||||
.navigationTitle(String(localized: "prefs_group_route"))
|
||||
.navigationTitle("prefs_group_route")
|
||||
.onAppear {
|
||||
hasPerspectiveViewWhileRouting = Settings.hasPerspectiveViewWhileRouting
|
||||
hasAutoZoomWhileRouting = Settings.hasAutoZoomWhileRouting
|
||||
|
||||
Reference in New Issue
Block a user