Skip to content

Commit 9e1eff0

Browse files
author
Marlon
committed
InfoPane now responsible for its padding
- Uses content margins instead of padding when it can to avoid content clipping during scrolling - Also fixes a few indentation inconsistencies - Adds min width for platforms section
1 parent 35314ce commit 9e1eff0

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

Xcodes/Frontend/InfoPane/InfoPane.swift

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ import struct XCModel.SDKs
99
struct InfoPane: View {
1010
let xcode: Xcode
1111
var body: some View {
12+
if #available(macOS 14.0, *) {
13+
mainContent
14+
.contentMargins(10, for: .scrollContent)
15+
} else {
16+
mainContent
17+
.padding()
18+
}
19+
}
20+
21+
private var mainContent: some View {
1222
ScrollView(.vertical) {
1323
HStack(alignment: .top) {
1424
VStack {
@@ -24,8 +34,7 @@ struct InfoPane: View {
2434
InfoPaneControls(xcode: xcode)
2535
}
2636
.xcodesBackground()
27-
28-
37+
2938
VStack {
3039
Text("Platforms")
3140
.font(.title3)
@@ -34,6 +43,7 @@ struct InfoPane: View {
3443
}
3544
.xcodesBackground()
3645
}
46+
.frame(minWidth: 380)
3747

3848
VStack(alignment: .leading) {
3949
ReleaseDateView(date: xcode.releaseDate, url: xcode.releaseNotesURL)
@@ -67,13 +77,13 @@ struct InfoPane: View {
6777
#Preview(XcodePreviewName.allCases[4].rawValue) { makePreviewContent(for: 4) }
6878

6979
private func makePreviewContent(for index: Int) -> some View {
70-
let name = XcodePreviewName.allCases[index]
80+
let name = XcodePreviewName.allCases[index]
7181
return InfoPane(xcode: xcodeDict[name]!)
7282
.environmentObject(configure(AppState()) {
73-
$0.allXcodes = [xcodeDict[name]!]
83+
$0.allXcodes = [xcodeDict[name]!]
7484
})
7585
.frame(width: 300, height: 400)
76-
.padding()
86+
.padding()
7787
}
7888

7989
enum XcodePreviewName: String, CaseIterable, Identifiable {
@@ -82,7 +92,7 @@ enum XcodePreviewName: String, CaseIterable, Identifiable {
8292
case Populated_Uninstalled
8393
case Basic_Installed
8494
case Basic_Installing
85-
95+
8696
var id: XcodePreviewName { self }
8797
}
8898

@@ -164,7 +174,7 @@ var downloadableRuntimes: [DownloadableRuntime] = {
164174
$0.completedUnitCount = 848_444_920
165175
$0.throughput = 9_211_681
166176
}
167-
)
177+
)
168178
)
169179
runtimes[watchOSIndex] = runtime
170180

Xcodes/Frontend/MainWindow.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ struct MainWindow: View {
4141
UnselectedView()
4242
}
4343
}
44-
.padding()
4544
.toolbar {
4645
ToolbarItemGroup {
4746
Button(action: { appState.presentedSheet = .signIn }, label: {

0 commit comments

Comments
 (0)