aboutsummaryrefslogtreecommitdiff
path: root/Map/Presentation/MapEditor.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-09-16 12:01:07 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-09-16 12:01:07 +0200
commitd3e21e6050fd8cfde6ff7c68d9f8dfedf7b6301f (patch)
tree3e9d76f8f4be7febedbd1dac01f1adc1c4c1b7db /Map/Presentation/MapEditor.swift
parent45e5a80ae378a72720114641c39148c199c6332d (diff)
Add glass
Diffstat (limited to 'Map/Presentation/MapEditor.swift')
-rw-r--r--Map/Presentation/MapEditor.swift86
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)