mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Remove extraneous vstack to fix swipe to disconnect and swipe to delete node
This commit is contained in:
parent
c023856d47
commit
669fb6de6b
4 changed files with 43 additions and 19 deletions
|
|
@ -77,6 +77,9 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
if connectedPeripheral != nil && connectedPeripheral.peripheral.state == CBPeripheralState.connected {
|
||||
|
||||
self.centralManager?.cancelPeripheralConnection(connectedPeripheral.peripheral)
|
||||
} else {
|
||||
connectedNode = nil
|
||||
connectedPeripheral = nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,9 +56,7 @@ struct Connect: View {
|
|||
Button {
|
||||
bleManager.disconnectDevice()
|
||||
} label: {
|
||||
VStack {
|
||||
Label("Disconnect", systemImage: "antenna.radiowaves.left.and.right.slash")
|
||||
}
|
||||
Label("Disconnect", systemImage: "antenna.radiowaves.left.and.right.slash")
|
||||
}
|
||||
.tint(.red)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,9 +62,7 @@ struct NodeList: View {
|
|||
meshData.nodes.remove(at: nodeIndex!)
|
||||
meshData.save()
|
||||
} label: {
|
||||
VStack {
|
||||
Label("Delete from app", systemImage: "trash")
|
||||
}
|
||||
Label("Delete from app", systemImage: "trash")
|
||||
}
|
||||
.tint(.red)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,23 +10,48 @@ struct NodeRow: View {
|
|||
HStack() {
|
||||
|
||||
CircleText(text: node.user.shortName, color: Color.blue).offset(y: 1).padding(.trailing, 5)
|
||||
Text(node.user.longName).font(.title2)
|
||||
.offset(x: -15)
|
||||
|
||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
Text(node.user.longName).font(.headline)
|
||||
.offset(x: -15)
|
||||
}
|
||||
else {
|
||||
Text(node.user.longName).font(.title)
|
||||
.offset(x: -15)
|
||||
}
|
||||
}
|
||||
.padding([.trailing])
|
||||
.padding(.bottom, 10)
|
||||
|
||||
HStack (alignment: .bottom){
|
||||
|
||||
Image(systemName: "timer.square").font(.headline).foregroundColor(.blue).symbolRenderingMode(.hierarchical)
|
||||
|
||||
if connected {
|
||||
Text("Currently Connected").font(.subheadline).foregroundColor(Color.accentColor)
|
||||
}
|
||||
else if node.lastHeard > 0 {
|
||||
let lastHeard = Date(timeIntervalSince1970: TimeInterval(node.lastHeard))
|
||||
Text("Last Heard: \(lastHeard, style: .relative) ago").font(.subheadline).foregroundColor(.gray)
|
||||
}
|
||||
else {
|
||||
Text("Last Heard: Unknown").font(.subheadline).foregroundColor(.gray)
|
||||
Image(systemName: "clock.badge.checkmark.fill").font(.headline).foregroundColor(.blue).symbolRenderingMode(.hierarchical)
|
||||
|
||||
|
||||
if UIDevice.current.userInterfaceIdiom == .pad {
|
||||
|
||||
if connected {
|
||||
Text("Currently Connected").font(.caption).foregroundColor(Color.accentColor)
|
||||
}
|
||||
else if node.lastHeard > 0 {
|
||||
let lastHeard = Date(timeIntervalSince1970: TimeInterval(node.lastHeard))
|
||||
Text("Last Heard: \(lastHeard, style: .relative) ago").font(.caption).foregroundColor(.gray)
|
||||
}
|
||||
else {
|
||||
Text("Last Heard: Unknown").font(.caption).foregroundColor(.gray)
|
||||
}
|
||||
|
||||
} else {
|
||||
if connected {
|
||||
Text("Currently Connected").font(.subheadline).foregroundColor(Color.accentColor)
|
||||
}
|
||||
else if node.lastHeard > 0 {
|
||||
let lastHeard = Date(timeIntervalSince1970: TimeInterval(node.lastHeard))
|
||||
Text("Last Heard: \(lastHeard, style: .relative) ago").font(.subheadline).foregroundColor(.gray)
|
||||
}
|
||||
else {
|
||||
Text("Last Heard: Unknown").font(.subheadline).foregroundColor(.gray)
|
||||
}
|
||||
}
|
||||
}
|
||||
}.padding([.leading, .top, .bottom])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue