From c21a68c807dcb84b4ce910ee0f73238a8019ffe9 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Tue, 8 Jul 2025 21:21:08 +0200 Subject: Allow export/import of preferences --- Map/Presentation/Preferences/MapPreferencesView.swift | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Map/Presentation/Preferences/MapPreferencesView.swift') diff --git a/Map/Presentation/Preferences/MapPreferencesView.swift b/Map/Presentation/Preferences/MapPreferencesView.swift index f6c909c..71e9d6c 100644 --- a/Map/Presentation/Preferences/MapPreferencesView.swift +++ b/Map/Presentation/Preferences/MapPreferencesView.swift @@ -16,10 +16,14 @@ import SwiftUI struct MapPreferencesView: View { - @AppStorage("showMapBackground") private var showBackground = true - @AppStorage("useCustomFont") private var useCustomFont = false - @AppStorage("customFontName") private var customFontName = "Helvetica" - @AppStorage("defaultExportFormat") private var defaultExportFormat = "png" + @AppStorage("showMapBackground") private var showBackground = UserPreferences.Defaults + .showMapBackground + @AppStorage("useCustomFont") private var useCustomFont = UserPreferences.Defaults.useCustomFont + @AppStorage("customFontName") private var customFontName = UserPreferences.Defaults.customFontName + @AppStorage("defaultExportFormat") private var defaultExportFormat = UserPreferences.Defaults + .defaultExportFormat + @AppStorage("useSmartLabelPositioning") private var useSmartLabelPositioning = UserPreferences + .Defaults.useSmartLabelPositioning var body: some View { VStack(alignment: .center, spacing: Dimensions.Spacing.loose) { @@ -36,6 +40,13 @@ struct MapPreferencesView: View { .font(.Theme.Body.regular) }) + Toggle( + isOn: $useSmartLabelPositioning, + label: { + Text("preferences.map.map_style.use_smart_label_positioning") + .font(.Theme.Body.regular) + }) + Toggle( isOn: $useCustomFont, label: { -- cgit