Skip to content

Commit

Permalink
Merge pull request #564 from LePips/left-align-unarchiving-pane
Browse files Browse the repository at this point in the history
Left Align Unarchiving Pane
  • Loading branch information
MattKiazyk authored Jun 28, 2024
2 parents f973e7d + 66deeb0 commit 8811a6d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion Xcodes/Frontend/InfoPane/InfoPane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ struct InfoPane: View {
#Preview(XcodePreviewName.allCases[2].rawValue) { makePreviewContent(for: 2) }
#Preview(XcodePreviewName.allCases[3].rawValue) { makePreviewContent(for: 3) }
#Preview(XcodePreviewName.allCases[4].rawValue) { makePreviewContent(for: 4) }
#Preview(XcodePreviewName.allCases[5].rawValue) { makePreviewContent(for: 5) }

private func makePreviewContent(for index: Int) -> some View {
let name = XcodePreviewName.allCases[index]
return InfoPane(xcode: xcodeDict[name]!)
.environmentObject(configure(AppState()) {
$0.allXcodes = [xcodeDict[name]!]
})
.frame(width: 300, height: 400)
.frame(width: 600, height: 400)
.padding()
}

Expand All @@ -92,6 +93,7 @@ enum XcodePreviewName: String, CaseIterable, Identifiable {
case Populated_Uninstalled
case Basic_Installed
case Basic_Installing
case Basic_Unarchiving

var id: XcodePreviewName { self }
}
Expand Down Expand Up @@ -152,6 +154,14 @@ var xcodeDict: [XcodePreviewName: Xcode] = [
sdks: nil,
compilers: nil
),
.Basic_Unarchiving: .init(
version: _versionWithMeta,
installState: .installing(.unarchiving),
selected: false,
icon: nil,
sdks: nil,
compilers: nil
),
]

var downloadableRuntimes: [DownloadableRuntime] = {
Expand Down
4 changes: 3 additions & 1 deletion Xcodes/Frontend/InfoPane/InfoPaneControls.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct InfoPaneControls: View {
case .installing(let installationStep):
HStack(alignment: .top) {
InstallationStepDetailView(installationStep: installationStep)
.frame(maxWidth: .infinity, alignment: .leading)
CancelInstallButton(xcode: xcode)
}
case .installed(_):
Expand All @@ -39,6 +40,7 @@ struct InfoPaneControls: View {
#Preview(XcodePreviewName.allCases[2].rawValue) { makePreviewContent(for: 2) }
#Preview(XcodePreviewName.allCases[3].rawValue) { makePreviewContent(for: 3) }
#Preview(XcodePreviewName.allCases[4].rawValue) { makePreviewContent(for: 4) }
#Preview(XcodePreviewName.allCases[5].rawValue) { makePreviewContent(for: 5) }

private func makePreviewContent(for index: Int) -> some View {
let name = XcodePreviewName.allCases[index]
Expand All @@ -47,6 +49,6 @@ private func makePreviewContent(for index: Int) -> some View {
.environmentObject(configure(AppState()) {
$0.allXcodes = [xcodeDict[name]!]
})
.frame(width: 300)
.frame(width: 500)
.padding()
}

0 comments on commit 8811a6d

Please sign in to comment.