diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-08 21:21:08 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-08 21:21:08 +0200 |
| commit | c21a68c807dcb84b4ce910ee0f73238a8019ffe9 (patch) | |
| tree | ae1e5e0fc7a846daf74623c6cd6270612ff0e56f /Map/Presentation/Commands/MapCommands.swift | |
| parent | 8f6da65a680cdd30ec541b3b226137004a1e4681 (diff) | |
Allow export/import of preferences
Diffstat (limited to 'Map/Presentation/Commands/MapCommands.swift')
| -rw-r--r-- | Map/Presentation/Commands/MapCommands.swift | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Map/Presentation/Commands/MapCommands.swift b/Map/Presentation/Commands/MapCommands.swift index 2d9809d..a298956 100644 --- a/Map/Presentation/Commands/MapCommands.swift +++ b/Map/Presentation/Commands/MapCommands.swift @@ -17,9 +17,11 @@ import UniformTypeIdentifiers struct MapCommands: Commands { - @AppStorage("viewStyle") var viewStyle: ViewStyle = .horizontal - @AppStorage("zoom") var zoom = 1.0 - @AppStorage("mapTemplates") private var templatesData: Data = Data() + @AppStorage("viewStyle") var viewStyle: ViewStyle = + ViewStyle(rawValue: UserPreferences.Defaults.viewStyle) ?? .horizontal + @AppStorage("zoom") var zoom = UserPreferences.Defaults.zoom + @AppStorage("mapTemplates") private var templatesData: Data = UserPreferences.Defaults + .mapTemplates @FocusedBinding(\.document) var document: MapDocument? @FocusedValue(\.fileURL) var url: URL? @FocusedBinding(\.selectedEvolution) var selectedEvolution: StageType? |