Fix connection card background on iOS

This commit is contained in:
世界
2025-12-04 11:44:31 +08:00
parent 7c8863b53a
commit c3c9284964
2 changed files with 62 additions and 58 deletions
@@ -16,16 +16,16 @@ public struct ConnectionListView: View {
Text("Empty connections")
} else {
ScrollView {
LazyVGrid(columns: [GridItem(.flexible())], alignment: .leading) {
VStack {
ForEach(viewModel.filteredConnections(), id: \.id) { it in
ConnectionView(it)
}
}
}
.padding()
}
}
}
}
#if !os(tvOS)
.toolbar {
ToolbarItem {
@@ -19,12 +19,12 @@ public struct ConnectionView: View {
}
@State private var alert: AlertState?
@State private var showDetails = false
public var body: some View {
FormNavigationLink {
ConnectionDetailsView(connection)
Button {
showDetails = true
} label: {
VStack {
HStack {
VStack(alignment: .leading) {
HStack(alignment: .center) {
@@ -75,16 +75,12 @@ public struct ConnectionView: View {
}
}
.foregroundColor(.textColor)
}
#if !os(tvOS)
.buttonStyle(.plain)
.padding(16)
.cardStyle()
#endif
}
.background(.clear)
}
#if !os(tvOS)
.buttonStyle(.borderless)
#endif
.alert($alert)
.contextMenu {
if connection.closedAt == nil {
@@ -96,6 +92,14 @@ public struct ConnectionView: View {
.frame(maxWidth: .infinity, alignment: .leading)
}
}
.background {
NavigationLink(isActive: $showDetails) {
ConnectionDetailsView(connection)
} label: {
EmptyView()
}
.opacity(0)
}
}
private nonisolated func closeConnection() async {