Skip to content

Commit 2069157

Browse files
committed
fix(map): polish coverage estimate location shortcut buttons
Replace the wrapping/hyphenating location shortcut labels with compact equal-width icon-over-label cells under a 'Set coordinates from' header, so 'My Location' / 'Map Center' stay on one line.
1 parent fb36edd commit 2069157

1 file changed

Lines changed: 27 additions & 12 deletions

File tree

Meshtastic/Views/Nodes/Helpers/Map/CoverageEstimateForm.swift

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,25 +171,40 @@ struct CoverageEstimateForm: View {
171171
@ViewBuilder private var locationShortcuts: some View {
172172
let hasShortcuts = deviceLocation != nil || seed.nodeCoordinate != nil || seed.mapCenter != nil
173173
if hasShortcuts {
174-
HStack(spacing: 12) {
175-
if let device = deviceLocation {
176-
shortcutButton("My Location", systemImage: "location.fill") { apply(device) }
177-
}
178-
if let node = seed.nodeCoordinate {
179-
shortcutButton("Node", systemImage: "flipphone") { apply(node) }
180-
}
181-
if let center = seed.mapCenter {
182-
shortcutButton("Map Center", systemImage: "scope") { apply(center) }
174+
VStack(alignment: .leading, spacing: 6) {
175+
Text("Set coordinates from")
176+
.font(.caption)
177+
.foregroundStyle(.secondary)
178+
HStack(spacing: 8) {
179+
if let device = deviceLocation {
180+
shortcutButton("My Location", systemImage: "location.fill") { apply(device) }
181+
}
182+
if let node = seed.nodeCoordinate {
183+
shortcutButton("Node", systemImage: "flipphone") { apply(node) }
184+
}
185+
if let center = seed.mapCenter {
186+
shortcutButton("Map Center", systemImage: "scope") { apply(center) }
187+
}
183188
}
189+
.buttonStyle(.bordered)
184190
}
185-
.buttonStyle(.bordered)
186-
.controlSize(.small)
187191
}
188192
}
189193

194+
/// A compact equal-width shortcut cell: icon over a single-line label, so long titles
195+
/// ("My Location", "Map Center") don't wrap or hyphenate in the three-across row.
190196
private func shortcutButton(_ title: LocalizedStringKey, systemImage: String, action: @escaping () -> Void) -> some View {
191197
Button(action: action) {
192-
Label(title, systemImage: systemImage)
198+
VStack(spacing: 4) {
199+
Image(systemName: systemImage)
200+
.font(.body)
201+
Text(title)
202+
.font(.caption2)
203+
.lineLimit(1)
204+
.minimumScaleFactor(0.75)
205+
}
206+
.frame(maxWidth: .infinity)
207+
.padding(.vertical, 4)
193208
}
194209
.accessibilityLabel(Text(title))
195210
.accessibilityHint("Fills the transmitter coordinates.")

0 commit comments

Comments
 (0)