From 3208a4d8d25a190f65334ff875bd516919ddcaef Mon Sep 17 00:00:00 2001 From: Brandon Evans Date: Sat, 6 Feb 2021 15:28:41 -0700 Subject: [PATCH] Put InfoPane content in ScrollView This issue was revealed when I broke the identical builds functionality with the Apple data source. https://github.com/RobotsAndPencils/XcodesApp/pull/100#pullrequestreview-584917125 --- Xcodes/Frontend/XcodeList/InfoPane.swift | 25 ++++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/Xcodes/Frontend/XcodeList/InfoPane.swift b/Xcodes/Frontend/XcodeList/InfoPane.swift index 4cbabf6..53d5088 100644 --- a/Xcodes/Frontend/XcodeList/InfoPane.swift +++ b/Xcodes/Frontend/XcodeList/InfoPane.swift @@ -11,8 +11,8 @@ struct InfoPane: View { @SwiftUI.Environment(\.openURL) var openURL: OpenURLAction var body: some View { - Group { - if let xcode = appState.allXcodes.first(where: { $0.id == selectedXcodeID }) { + if let xcode = appState.allXcodes.first(where: { $0.id == selectedXcodeID }) { + ScrollView { VStack(spacing: 16) { icon(for: xcode) @@ -61,12 +61,13 @@ struct InfoPane: View { Spacer() } - } else { - empty + .padding() } + .frame(minWidth: 200, maxWidth: .infinity) + } else { + empty + .frame(minWidth: 200, maxWidth: .infinity) } - .padding() - .frame(minWidth: 200, maxWidth: .infinity) } @ViewBuilder @@ -212,13 +213,11 @@ struct InfoPane: View { @ViewBuilder private var empty: some View { - VStack { - Spacer() - Text("No Xcode Selected") - .font(.title) - .foregroundColor(.secondary) - Spacer() - } + Text("No Xcode Selected") + .font(.title) + .foregroundColor(.secondary) + .frame(maxWidth: .infinity, maxHeight: .infinity) + .padding() } }