mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Merge pull request #103 from RobotsAndPencils/fix-split-view
Remove info pane from split view instead of hiding it
This commit is contained in:
commit
519df4e63c
1 changed files with 16 additions and 13 deletions
|
|
@ -24,19 +24,11 @@ struct MainWindow: View {
|
|||
primaryButton: .destructive(Text("Uninstall"), action: { self.appState.uninstall(id: xcode.id) }),
|
||||
secondaryButton: .cancel(Text("Cancel")))
|
||||
}
|
||||
InfoPane(selectedXcodeID: selectedXcodeID)
|
||||
.frame(minWidth: 300, maxWidth: .infinity)
|
||||
.frame(width: isShowingInfoPane ? nil : 0)
|
||||
.isHidden(!isShowingInfoPane)
|
||||
// This alert isn't intentionally placed here,
|
||||
// just trying to put it in a unique part of the hierarchy
|
||||
// since you can't have more than one in the same spot.
|
||||
.alert(item: $appState.xcodeBeingConfirmedForInstallCancellation) { xcode in
|
||||
Alert(title: Text("Are you sure you want to stop the installation of Xcode \(xcode.description)?"),
|
||||
message: Text("Any progress will be discarded."),
|
||||
primaryButton: .destructive(Text("Stop Installation"), action: { self.appState.cancelInstall(id: xcode.id) }),
|
||||
secondaryButton: .cancel(Text("Cancel")))
|
||||
}
|
||||
|
||||
if isShowingInfoPane {
|
||||
InfoPane(selectedXcodeID: selectedXcodeID)
|
||||
.frame(minWidth: 300, maxWidth: .infinity)
|
||||
}
|
||||
}
|
||||
.mainToolbar(
|
||||
category: $category,
|
||||
|
|
@ -51,6 +43,17 @@ struct MainWindow: View {
|
|||
.environmentObject(appState)
|
||||
}
|
||||
// This overlay is only here to work around the one-alert-per-view limitation
|
||||
.overlay(
|
||||
Color.clear
|
||||
// This particular alert could be added specifically to InstallationStepView and CancelInstallButton _except_ for when CancelInstallButton is used in the Xcode CommandMenu, so it's here for now.
|
||||
.alert(item: $appState.xcodeBeingConfirmedForInstallCancellation) { xcode in
|
||||
Alert(title: Text("Are you sure you want to stop the installation of Xcode \(xcode.description)?"),
|
||||
message: Text("Any progress will be discarded."),
|
||||
primaryButton: .destructive(Text("Stop Installation"), action: { self.appState.cancelInstall(id: xcode.id) }),
|
||||
secondaryButton: .cancel(Text("Cancel")))
|
||||
}
|
||||
)
|
||||
// This overlay is only here to work around the one-alert-per-view limitation
|
||||
.overlay(
|
||||
Color.clear
|
||||
.alert(isPresented: $appState.isPreparingUserForActionRequiringHelper.isNotNil) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue