mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Waypoint details updates
This commit is contained in:
parent
d1ad0bfd20
commit
cd68873fb2
2 changed files with 16 additions and 6 deletions
|
|
@ -193,11 +193,11 @@ struct NodeMapSwiftUI: View {
|
|||
.padding(.horizontal, 20)
|
||||
}
|
||||
}
|
||||
.popover(item: $selectedWaypoint) { selection in
|
||||
.sheet(item: $selectedWaypoint) { selection in
|
||||
WaypointPopover(waypoint: selection)
|
||||
.presentationDetents([.fraction(0.2), .medium])
|
||||
.padding()
|
||||
.opacity(0.8)
|
||||
.presentationCompactAdaptation(.sheet)
|
||||
}
|
||||
.sheet(isPresented: $isEditingSettings) {
|
||||
VStack {
|
||||
|
|
@ -282,9 +282,7 @@ struct NodeMapSwiftUI: View {
|
|||
.padding()
|
||||
#endif
|
||||
}
|
||||
//.presentationDetents([.fraction(0.60)])
|
||||
.presentationDetents([.medium, .large])
|
||||
.presentationDragIndicator(.visible)
|
||||
.presentationDetents([.fraction(0.4), .medium])
|
||||
}
|
||||
.onChange(of: node) {
|
||||
let mostRecent = node.positions?.lastObject as? PositionEntity
|
||||
|
|
|
|||
|
|
@ -9,12 +9,13 @@ import SwiftUI
|
|||
import MapKit
|
||||
|
||||
struct WaypointPopover: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
var waypoint: WaypointEntity
|
||||
let distanceFormatter = MKDistanceFormatter()
|
||||
var body: some View {
|
||||
VStack {
|
||||
HStack {
|
||||
CircleText(text: String(UnicodeScalar(Int(waypoint.icon)) ?? "📍"), color: Color.blue)
|
||||
CircleText(text: String(UnicodeScalar(Int(waypoint.icon)) ?? "📍"), color: Color.orange)
|
||||
Text(waypoint.name ?? "?")
|
||||
.font(.title3)
|
||||
if waypoint.locked > 0 {
|
||||
|
|
@ -92,6 +93,17 @@ struct WaypointPopover: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
#if targetEnvironment(macCatalyst)
|
||||
Button {
|
||||
dismiss()
|
||||
} label: {
|
||||
Label("close", systemImage: "xmark")
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
.buttonBorderShape(.capsule)
|
||||
.controlSize(.large)
|
||||
.padding()
|
||||
#endif
|
||||
}
|
||||
.tag(waypoint.id)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue