Fix form on tvOS
This commit is contained in:
@@ -11,29 +11,49 @@ public func FormView(@ViewBuilder content: () -> some View) -> some View {
|
||||
}
|
||||
|
||||
public func FormTextItem(_ name: LocalizedStringKey, _ value: String) -> some View {
|
||||
#if os(tvOS)
|
||||
Button {} label: {
|
||||
HStack {
|
||||
Text(name)
|
||||
Spacer()
|
||||
Text(value)
|
||||
.multilineTextAlignment(.trailing)
|
||||
.font(Font.system(.caption, design: .monospaced))
|
||||
#if os(iOS) || os(macOS)
|
||||
.textSelection(.enabled)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#else
|
||||
HStack {
|
||||
Text(name)
|
||||
Spacer()
|
||||
Text(value)
|
||||
.multilineTextAlignment(.trailing)
|
||||
.font(Font.system(.caption, design: .monospaced))
|
||||
.textSelection(.enabled)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public func FormTextItem(_ name: LocalizedStringKey, _ systemImage: String, @ViewBuilder _ value: () -> some View) -> some View {
|
||||
#if os(tvOS)
|
||||
Button {} label: {
|
||||
HStack {
|
||||
Label(name, systemImage: systemImage)
|
||||
Spacer()
|
||||
value()
|
||||
.multilineTextAlignment(.trailing)
|
||||
.font(Font.system(.caption, design: .monospaced))
|
||||
#if os(iOS) || os(macOS)
|
||||
.textSelection(.enabled)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#else
|
||||
HStack {
|
||||
Label(name, systemImage: systemImage)
|
||||
Spacer()
|
||||
value()
|
||||
.multilineTextAlignment(.trailing)
|
||||
.font(Font.system(.caption, design: .monospaced))
|
||||
.textSelection(.enabled)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public func FormItem(_ title: String, @ViewBuilder content: () -> some View) -> some View {
|
||||
|
||||
@@ -35,7 +35,7 @@ public struct NavigationButtonsView: View {
|
||||
|
||||
#if os(tvOS)
|
||||
private var tvOSBody: some View {
|
||||
Group {
|
||||
HStack {
|
||||
if showConnectionsButton {
|
||||
Button {
|
||||
onConnectionsTap()
|
||||
|
||||
@@ -99,6 +99,13 @@ public struct ConnectionView: View {
|
||||
.background {
|
||||
NavigationLink(isActive: $showDetails) {
|
||||
ConnectionDetailsView(connection)
|
||||
#if os(tvOS)
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .topBarLeading) {
|
||||
BackButton()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} label: {
|
||||
EmptyView()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user