aboutsummaryrefslogtreecommitdiff
path: root/Map/Presentation/MapEditor.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-07-08 21:21:08 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-07-08 21:21:08 +0200
commitc21a68c807dcb84b4ce910ee0f73238a8019ffe9 (patch)
treeae1e5e0fc7a846daf74623c6cd6270612ff0e56f /Map/Presentation/MapEditor.swift
parent8f6da65a680cdd30ec541b3b226137004a1e4681 (diff)
Allow export/import of preferences
Diffstat (limited to 'Map/Presentation/MapEditor.swift')
-rw-r--r--Map/Presentation/MapEditor.swift13
1 files changed, 8 insertions, 5 deletions
diff --git a/Map/Presentation/MapEditor.swift b/Map/Presentation/MapEditor.swift
index 73302df..11545e2 100644
--- a/Map/Presentation/MapEditor.swift
+++ b/Map/Presentation/MapEditor.swift
@@ -22,13 +22,16 @@ struct MapEditor: View {
private let changeDebouncer: Debouncer = Debouncer(seconds: 0.05)
- @AppStorage("viewStyle") var viewStyle: ViewStyle = .horizontal
- @AppStorage("useCustomEditorFont") var useCustomEditorFont: Bool = false
- @AppStorage("customEditorFontName") var customEditorFontName: String = "Menlo"
- @AppStorage("editorFontSize") var editorFontSize: Double = 14
+ @AppStorage("viewStyle") var viewStyle: ViewStyle =
+ ViewStyle(rawValue: UserPreferences.Defaults.viewStyle) ?? .horizontal
+ @AppStorage("useCustomEditorFont") var useCustomEditorFont: Bool = UserPreferences.Defaults
+ .useCustomEditorFont
+ @AppStorage("customEditorFontName") var customEditorFontName: String = UserPreferences.Defaults
+ .customEditorFontName
+ @AppStorage("editorFontSize") var editorFontSize: Double = UserPreferences.Defaults.editorFontSize
let zoomRange = Constants.kMinZoom...Constants.kMaxZoom
- @AppStorage("zoom") var zoom = 1.0
+ @AppStorage("zoom") var zoom = UserPreferences.Defaults.zoom
@State var lastZoom = 1.0
@State var searchTerm = ""
@State var selectedTerm = 0