From 35314ce36f2568c3b4a8304731898bcbe2cd7c32 Mon Sep 17 00:00:00 2001 From: Marlon Date: Tue, 19 Mar 2024 22:45:51 -0400 Subject: [PATCH] Adjusts layout of platform views --- Xcodes/Frontend/InfoPane/PlatformsView.swift | 46 ++++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Xcodes/Frontend/InfoPane/PlatformsView.swift b/Xcodes/Frontend/InfoPane/PlatformsView.swift index 1c946ee..2ec9b29 100644 --- a/Xcodes/Frontend/InfoPane/PlatformsView.swift +++ b/Xcodes/Frontend/InfoPane/PlatformsView.swift @@ -40,33 +40,33 @@ struct PlatformsView: View { Text("\(runtime.visibleIdentifier)") .font(.headline) pathIfAvailable(xcode: xcode, runtime: runtime) + + if runtime.installState == .notInstalled { + // TODO: Update the downloadableRuntimes with the appropriate installState so we don't have to check path awkwardly + if appState.runtimeInstallPath(xcode: xcode, runtime: runtime) != nil { + EmptyView() + } else { + HStack { + Spacer() + DownloadRuntimeButton(runtime: runtime) + } + } + } + Spacer() Text(runtime.downloadFileSizeString) .font(.subheadline) + .frame(width: 70, alignment: .trailing) } - switch runtime.installState { - case .installed: - EmptyView() - case .notInstalled: - // TODO: Update the downloadableRuntimes with the appropriate installState so we don't have to check path awkwardly - if let path = appState.runtimeInstallPath(xcode: xcode, runtime: runtime) { - EmptyView() - } else { - HStack { - Spacer() - DownloadRuntimeButton(runtime: runtime) - } - } - - case .installing(let installationStep): - HStack(alignment: .top, spacing: 5){ - RuntimeInstallationStepDetailView(installationStep: installationStep) - .fixedSize(horizontal: false, vertical: true) - Spacer() - CancelRuntimeInstallButton(runtime: runtime) - } - - } + + if case let .installing(installationStep) = runtime.installState { + HStack(alignment: .top, spacing: 5){ + RuntimeInstallationStepDetailView(installationStep: installationStep) + .fixedSize(horizontal: false, vertical: true) + Spacer() + CancelRuntimeInstallButton(runtime: runtime) + } + } } }