mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-04-26 14:57:37 +00:00
Move installation step beside cancel button in info pane
This commit is contained in:
parent
2f04d23eac
commit
22894e2d6d
1 changed files with 32 additions and 48 deletions
|
|
@ -13,44 +13,46 @@ struct InfoPane: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
if let xcode = appState.allXcodes.first(where: { $0.id == selectedXcodeID }) {
|
if let xcode = appState.allXcodes.first(where: { $0.id == selectedXcodeID }) {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
VStack(spacing: 16) {
|
VStack(alignment: .leading, spacing: 16) {
|
||||||
icon(for: xcode)
|
icon(for: xcode)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .center)
|
||||||
|
|
||||||
|
Text(verbatim: "Xcode \(xcode.description) \(xcode.version.buildMetadataIdentifiersDisplay)")
|
||||||
|
.font(.title)
|
||||||
|
|
||||||
VStack(alignment: .leading) {
|
switch xcode.installState {
|
||||||
Text(verbatim: "Xcode \(xcode.description) \(xcode.version.buildMetadataIdentifiersDisplay)")
|
case .notInstalled:
|
||||||
.font(.title)
|
InstallButton(xcode: xcode)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
downloadFileSize(for: xcode)
|
||||||
|
case .installing(let installationStep):
|
||||||
|
InstallationStepDetailView(installationStep: installationStep)
|
||||||
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
|
CancelInstallButton(xcode: xcode)
|
||||||
|
case let .installed(path):
|
||||||
|
HStack {
|
||||||
|
Text(path.string)
|
||||||
|
Button(action: { appState.reveal(id: xcode.id) }) {
|
||||||
|
Image(systemName: "arrow.right.circle.fill")
|
||||||
|
}
|
||||||
|
.buttonStyle(PlainButtonStyle())
|
||||||
|
.help("Reveal in Finder")
|
||||||
|
}
|
||||||
|
|
||||||
switch xcode.installState {
|
HStack {
|
||||||
case .notInstalled:
|
SelectButton(xcode: xcode)
|
||||||
InstallButton(xcode: xcode)
|
.disabled(xcode.selected)
|
||||||
case .installing:
|
.help("Selected")
|
||||||
CancelInstallButton(xcode: xcode)
|
|
||||||
case let .installed(path):
|
|
||||||
HStack {
|
|
||||||
Text(path.string)
|
|
||||||
Button(action: { appState.reveal(id: xcode.id) }) {
|
|
||||||
Image(systemName: "arrow.right.circle.fill")
|
|
||||||
}
|
|
||||||
.buttonStyle(PlainButtonStyle())
|
|
||||||
.help("Reveal in Finder")
|
|
||||||
}
|
|
||||||
|
|
||||||
HStack {
|
OpenButton(xcode: xcode)
|
||||||
SelectButton(xcode: xcode)
|
.help("Open")
|
||||||
.disabled(xcode.selected)
|
|
||||||
.help("Selected")
|
Spacer()
|
||||||
|
UninstallButton(xcode: xcode)
|
||||||
OpenButton(xcode: xcode)
|
|
||||||
.help("Open")
|
|
||||||
|
|
||||||
Spacer()
|
|
||||||
UninstallButton(xcode: xcode)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
|
|
||||||
Group{
|
Group{
|
||||||
releaseNotes(for: xcode)
|
releaseNotes(for: xcode)
|
||||||
identicalBuilds(for: xcode)
|
identicalBuilds(for: xcode)
|
||||||
|
|
@ -58,10 +60,6 @@ struct InfoPane: View {
|
||||||
sdks(for: xcode)
|
sdks(for: xcode)
|
||||||
compilers(for: xcode)
|
compilers(for: xcode)
|
||||||
}
|
}
|
||||||
Group {
|
|
||||||
downloadFileSize(for: xcode)
|
|
||||||
downloadStats(for: xcode)
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
|
@ -214,20 +212,6 @@ struct InfoPane: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private func downloadStats(for xcode: Xcode) -> some View {
|
|
||||||
switch xcode.installState {
|
|
||||||
case let .installing(installationStep):
|
|
||||||
Divider()
|
|
||||||
InstallationStepDetailView(
|
|
||||||
installationStep: installationStep
|
|
||||||
)
|
|
||||||
default:
|
|
||||||
EmptyView()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var empty: some View {
|
private var empty: some View {
|
||||||
Text("No Xcode Selected")
|
Text("No Xcode Selected")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue