diff --git a/Meshtastic/Views/Nodes/Helpers/NodeDetail.swift b/Meshtastic/Views/Nodes/Helpers/NodeDetail.swift index 2637e81c..1dd43ba4 100644 --- a/Meshtastic/Views/Nodes/Helpers/NodeDetail.swift +++ b/Meshtastic/Views/Nodes/Helpers/NodeDetail.swift @@ -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) - } +// } } } diff --git a/Meshtastic/Views/Nodes/NodeList.swift b/Meshtastic/Views/Nodes/NodeList.swift index 2d916934..7aa17db0 100644 --- a/Meshtastic/Views/Nodes/NodeList.swift +++ b/Meshtastic/Views/Nodes/NodeList.swift @@ -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