Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ struct NavigationSplitViewWrapper<Sidebar, Detail>: View where Sidebar: View, De
NavigationSplitView {
if #available(macOS 14, *) {
sidebar
.navigationSplitViewColumnWidth(min: 290, ideal: 290)
.navigationSplitViewColumnWidth(
min: MainWindowLayout.sidebarMinimumWidth,
ideal: MainWindowLayout.sidebarMinimumWidth
)
} else {
sidebar
}
Expand Down
6 changes: 3 additions & 3 deletions Xcodes/Frontend/InfoPane/InfoPane.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct InfoPane: View {

private var mainContent: some View {
ScrollView(.vertical) {
HStack(alignment: .top) {
HStack(alignment: .top, spacing: MainWindowLayout.infoPaneColumnSpacing) {
VStack {
VStack(spacing: 5) {
HStack {
Expand All @@ -35,15 +35,15 @@ struct InfoPane: View {

PlatformsView(xcode: xcode)
}
.frame(minWidth: 380)
.frame(minWidth: MainWindowLayout.infoPanePrimaryColumnMinimumWidth)

VStack(alignment: .leading) {
ReleaseDateView(date: xcode.releaseDate, url: xcode.releaseNotesURL)
CompatibilityView(requiredMacOSVersion: xcode.requiredMacOSVersion)
IdenticalBuildsView(builds: xcode.identicalBuildsForCurrentVariant)
SDKandCompilers
}
.frame(width: 200)
.frame(width: MainWindowLayout.infoPaneSecondaryColumnWidth)

}
}
Expand Down
17 changes: 16 additions & 1 deletion Xcodes/Frontend/MainWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ import XcodesLoginKit
import Path
import Version

enum MainWindowLayout {
static let sidebarMinimumWidth: CGFloat = 290
static let infoPanePrimaryColumnMinimumWidth: CGFloat = 380
static let infoPaneSecondaryColumnWidth: CGFloat = 200
static let infoPaneColumnSpacing: CGFloat = 8
static let infoPaneHorizontalMargins: CGFloat = 20
static let detailMinimumWidth =
infoPanePrimaryColumnMinimumWidth +
infoPaneSecondaryColumnWidth +
infoPaneColumnSpacing +
infoPaneHorizontalMargins
static let splitViewDividerWidth: CGFloat = 9
static let minimumWidth = sidebarMinimumWidth + detailMinimumWidth + splitViewDividerWidth
}

struct MainWindow: View {
@EnvironmentObject var appState: AppState
@State private var selectedXcodeID: Xcode.ID?
Expand Down Expand Up @@ -68,7 +83,7 @@ struct MainWindow: View {
.bottomStatusBar()
.padding([.top], 0)
.navigationSubtitle(subtitleText)
.frame(minWidth: 600, maxWidth: .infinity, minHeight: 300, maxHeight: .infinity)
.frame(minWidth: MainWindowLayout.minimumWidth, maxWidth: .infinity, minHeight: 300, maxHeight: .infinity)
.emittingError($appState.error, recoveryHandler: { _ in })
.sheet(item: $appState.presentedSheet) { sheet in
switch sheet {
Expand Down