diff options
Diffstat (limited to 'Map/Presentation/MapEditor.swift')
| -rw-r--r-- | Map/Presentation/MapEditor.swift | 86 |
1 files changed, 61 insertions, 25 deletions
diff --git a/Map/Presentation/MapEditor.swift b/Map/Presentation/MapEditor.swift index f9a8dae..f5589e5 100644 --- a/Map/Presentation/MapEditor.swift +++ b/Map/Presentation/MapEditor.swift @@ -142,7 +142,9 @@ struct MapEditor: View { .onChange(of: document.text) { _, _ in buildVertexLineMap() } - }.background(Color.Theme.UI.background) + .padding(.bottom, Dimensions.MapEditor.additionalPadding) + } + .background(Color.Theme.UI.background) .gesture( MagnificationGesture() .onChanged { value in @@ -156,30 +158,64 @@ struct MapEditor: View { ) } } - Divider() - HStack { - Spacer() - Slider( - value: $zoom, in: zoomRange, step: 0.1, - label: { - Text(formatZoom(zoom)) - .font(.Theme.SmallControl.regular) - }, - minimumValueLabel: { - Image(systemName: "minus.magnifyingglass") - .font(.Theme.SmallControl.regular) - .help("map_editor.zoom_out") - }, - maximumValueLabel: { - Image(systemName: "plus.magnifyingglass") - .font(.Theme.SmallControl.regular) - .help("map_editor.zoom_in") - } - ).frame(width: 200).padding(.trailing, 10.0) - }.padding(4.0) - }.toolbar { - ToolbarItem(placement: .primaryAction) { - EvolutionPicker(selectedEvolution: $selectedEvolution) + + if #unavailable(macOS 26) { + Divider() + HStack { + Spacer() + Slider( + value: $zoom, in: zoomRange, step: 0.1, + label: { + Text(formatZoom(zoom)) + .font(.Theme.SmallControl.regular) + }, + minimumValueLabel: { + Image(systemName: "minus.magnifyingglass") + .font(.Theme.SmallControl.regular) + .help("map_editor.zoom_out") + }, + maximumValueLabel: { + Image(systemName: "plus.magnifyingglass") + .font(.Theme.SmallControl.regular) + .help("map_editor.zoom_in") + } + ).frame(width: 200).padding(.trailing, 10.0) + }.padding(4.0) + } + } + .safeAreaInset(edge: .bottom, alignment: .trailing) { + if #available(macOS 26, *) { + HStack { + Slider( + value: $zoom, in: zoomRange, step: 0.1, + label: { + Text(formatZoom(zoom)) + .font(.Theme.SmallControl.regular) + }, + minimumValueLabel: { + Image(systemName: "minus.magnifyingglass") + .font(.Theme.SmallControl.regular) + .help("map_editor.zoom_out") + }, + maximumValueLabel: { + Image(systemName: "plus.magnifyingglass") + .font(.Theme.SmallControl.regular) + .help("map_editor.zoom_in") + } + ).frame(width: 200) + .padding(Dimensions.Spacing.regular) + .glassEffect(.regular) + GlassEvolutionPicker(selectedEvolution: $selectedEvolution) + } + .padding(Dimensions.Spacing.regular) + + } + } + .toolbar { + if #unavailable(macOS 26) { + ToolbarItem(placement: .primaryAction) { + EvolutionPicker(selectedEvolution: $selectedEvolution) + } } } .focusedSceneValue(\.isSearching, $isSearching) |