From ea4b7548a640321c90628b71af4cce3d41a4728c Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 20 Oct 2023 19:59:26 -0700 Subject: [PATCH] More waypoint popover cleanup --- .../Views/Nodes/Helpers/NodeMapSwiftUI.swift | 2 +- .../Views/Nodes/Helpers/WaypointPopover.swift | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Meshtastic/Views/Nodes/Helpers/NodeMapSwiftUI.swift b/Meshtastic/Views/Nodes/Helpers/NodeMapSwiftUI.swift index aa9dd77f..44812c90 100644 --- a/Meshtastic/Views/Nodes/Helpers/NodeMapSwiftUI.swift +++ b/Meshtastic/Views/Nodes/Helpers/NodeMapSwiftUI.swift @@ -195,7 +195,7 @@ struct NodeMapSwiftUI: View { } .sheet(item: $selectedWaypoint) { selection in WaypointPopover(waypoint: selection) - .presentationDetents([.fraction(0.2), .medium]) + .presentationDetents([.fraction(0.3), .medium]) .padding() .opacity(0.8) } diff --git a/Meshtastic/Views/Nodes/Helpers/WaypointPopover.swift b/Meshtastic/Views/Nodes/Helpers/WaypointPopover.swift index 19d5c309..3eae5eb8 100644 --- a/Meshtastic/Views/Nodes/Helpers/WaypointPopover.swift +++ b/Meshtastic/Views/Nodes/Helpers/WaypointPopover.swift @@ -32,7 +32,6 @@ struct WaypointPopover: View { Label { Text(waypoint.longDescription ?? "") .foregroundColor(.primary) - .font(.footnote) .multilineTextAlignment(.leading) .fixedSize(horizontal: false, vertical: true) } icon: { @@ -41,43 +40,57 @@ struct WaypointPopover: View { .frame(width: 35) } .padding(.bottom, 5) + Divider() } + /// Coordinate + Label { + Text("Coordinates: \(String(format: "%.6f", waypoint.coordinate.latitude)), \(String(format: "%.6f", waypoint.coordinate.longitude))") + //.font(.footnote) + .textSelection(.enabled) + .foregroundColor(.primary) + } icon: { + Image(systemName: "mappin.and.ellipse") + .symbolRenderingMode(.hierarchical) + .frame(width: 35) + } + .padding(.bottom, 5) + Divider() /// Created Label { Text("Created: \(waypoint.created?.formatted() ?? "?")") .foregroundColor(.primary) - .font(.footnote) } icon: { Image(systemName: "clock.badge.checkmark") .symbolRenderingMode(.hierarchical) .frame(width: 35) } .padding(.bottom, 5) + Divider() /// Updated if waypoint.lastUpdated != nil { Label { Text("Updated: \(waypoint.lastUpdated?.formatted() ?? "?")") .foregroundColor(.primary) - .font(.footnote) } icon: { Image(systemName: "clock.arrow.circlepath") .symbolRenderingMode(.hierarchical) .frame(width: 35) } .padding(.bottom, 5) + Divider() } - /// Updated + /// Expires if waypoint.expire != nil { Label { Text("Expires: \(waypoint.expire?.formatted() ?? "?")") .foregroundColor(.primary) - .font(.footnote) } icon: { Image(systemName: "clock.badge.xmark") .symbolRenderingMode(.hierarchical) .frame(width: 35) } .padding(.bottom, 5) + Divider() } /// Distance if LocationHelper.currentLocation.distance(from: LocationHelper.DefaultLocation) > 0.0 { @@ -85,12 +98,13 @@ struct WaypointPopover: View { Label { Text("distance".localized + ": \(distanceFormatter.string(fromDistance: Double(metersAway)))") .foregroundColor(.primary) - .font(.footnote) } icon: { Image(systemName: "lines.measurement.horizontal") .symbolRenderingMode(.hierarchical) .frame(width: 35) } + .padding(.bottom, 5) + Divider() } } #if targetEnvironment(macCatalyst)