mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Detail only button on node details view
This commit is contained in:
parent
e8d4a70857
commit
b613d0427e
2 changed files with 28 additions and 26 deletions
|
|
@ -22,7 +22,7 @@ struct NodeDetail: View {
|
|||
var body: some View {
|
||||
|
||||
let connectedNode = getNodeInfo(id: bleManager.connectedPeripheral?.num ?? -1, context: context)
|
||||
NavigationStack {
|
||||
// NavigationStack {
|
||||
GeometryReader { bounds in
|
||||
VStack {
|
||||
ScrollView {
|
||||
|
|
@ -145,18 +145,8 @@ struct NodeDetail: View {
|
|||
self.bleManager.context = context
|
||||
}
|
||||
}
|
||||
.edgesIgnoringSafeArea([.leading, .trailing])
|
||||
.navigationBarTitle(String(node.user?.longName ?? "unknown".localized), displayMode: .inline)
|
||||
.navigationBarItems(
|
||||
trailing:
|
||||
ZStack {
|
||||
ConnectedDevice(
|
||||
bluetoothOn: bleManager.isSwitchedOn,
|
||||
deviceConnected: bleManager.connectedPeripheral != nil,
|
||||
name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "?", phoneOnly: true)
|
||||
})
|
||||
}
|
||||
.padding(.bottom, 2)
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,13 +66,25 @@ struct NodeList: View {
|
|||
})
|
||||
} content: {
|
||||
if let node = selectedNode {
|
||||
NodeDetail(node: node, columnVisibility: columnVisibility)
|
||||
VStack {
|
||||
Button {
|
||||
columnVisibility = .detailOnly
|
||||
} label: {
|
||||
Image(systemName: "rectangle")
|
||||
}
|
||||
NavigationStack {
|
||||
NodeDetail(node: node, columnVisibility: columnVisibility)
|
||||
.edgesIgnoringSafeArea([.leading, .trailing])
|
||||
.navigationBarTitle(String(node.user?.longName ?? "unknown".localized), displayMode: .inline)
|
||||
.navigationBarItems(
|
||||
trailing:
|
||||
ZStack {
|
||||
if (UIDevice.current.userInterfaceIdiom != .phone) {
|
||||
Button {
|
||||
columnVisibility = .detailOnly
|
||||
} label: {
|
||||
Image(systemName: "rectangle")
|
||||
}
|
||||
}
|
||||
ConnectedDevice(
|
||||
bluetoothOn: bleManager.isSwitchedOn,
|
||||
deviceConnected: bleManager.connectedPeripheral != nil,
|
||||
name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "?", phoneOnly: true)
|
||||
})
|
||||
}
|
||||
.padding(.bottom, 5)
|
||||
} else {
|
||||
|
|
@ -82,13 +94,13 @@ struct NodeList: View {
|
|||
Text("Select something to view")
|
||||
}
|
||||
.navigationSplitViewStyle(.balanced)
|
||||
.onChange(of: selectedNode) { _ in
|
||||
if selectedNode == nil {
|
||||
columnVisibility = .all
|
||||
} else {
|
||||
columnVisibility = .doubleColumn
|
||||
}
|
||||
}
|
||||
// .onChange(of: selectedNode) { _ in
|
||||
// if selectedNode == nil {
|
||||
// columnVisibility = .all
|
||||
// } else {
|
||||
// columnVisibility = .doubleColumn
|
||||
// }
|
||||
// }
|
||||
.onAppear {
|
||||
if self.bleManager.context == nil {
|
||||
self.bleManager.context = context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue