Skip to content

Commit 238f974

Browse files
committed
Merge branch 'main' into remove_outdated_version_checks
# Conflicts: # Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift
2 parents 74d8f39 + b89fc21 commit 238f974

File tree

12 files changed

+89
-41
lines changed

12 files changed

+89
-41
lines changed

Xcodes.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
B0C6AD042AD6E65700E64698 /* ReleaseDateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0C6AD032AD6E65700E64698 /* ReleaseDateView.swift */; };
2626
B0C6AD0B2AD9178E00E64698 /* IdenticalBuildView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0C6AD0A2AD9178E00E64698 /* IdenticalBuildView.swift */; };
2727
B0C6AD0D2AD91D7900E64698 /* IconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0C6AD0C2AD91D7900E64698 /* IconView.swift */; };
28+
BDBAB7452B9FF55800694B0B /* TrailingIconLabelStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDBAB7442B9FF55800694B0B /* TrailingIconLabelStyle.swift */; };
2829
CA11E7BA2598476C00D2EE1C /* XcodeCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA11E7B92598476C00D2EE1C /* XcodeCommands.swift */; };
2930
CA2518EC25A7FF2B00F08414 /* AppStateUpdateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA2518EB25A7FF2B00F08414 /* AppStateUpdateTests.swift */; };
3031
CA25192A25A9644800F08414 /* XcodeInstallState.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA25192925A9644800F08414 /* XcodeInstallState.swift */; };
@@ -209,6 +210,7 @@
209210
B0C6AD032AD6E65700E64698 /* ReleaseDateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReleaseDateView.swift; sourceTree = "<group>"; };
210211
B0C6AD0A2AD9178E00E64698 /* IdenticalBuildView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdenticalBuildView.swift; sourceTree = "<group>"; };
211212
B0C6AD0C2AD91D7900E64698 /* IconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconView.swift; sourceTree = "<group>"; };
213+
BDBAB7442B9FF55800694B0B /* TrailingIconLabelStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrailingIconLabelStyle.swift; sourceTree = "<group>"; };
212214
CA11E7B92598476C00D2EE1C /* XcodeCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcodeCommands.swift; sourceTree = "<group>"; };
213215
CA2518EB25A7FF2B00F08414 /* AppStateUpdateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppStateUpdateTests.swift; sourceTree = "<group>"; };
214216
CA25192925A9644800F08414 /* XcodeInstallState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcodeInstallState.swift; sourceTree = "<group>"; };
@@ -380,6 +382,7 @@
380382
536CFDD3263C9A8000026CE0 /* XcodesSheet.swift */,
381383
53CBAB2B263DCC9100410495 /* XcodesAlert.swift */,
382384
E84B7D0C2B296A8900DBDA2B /* NavigationSplitViewWrapper.swift */,
385+
BDBAB7442B9FF55800694B0B /* TrailingIconLabelStyle.swift */,
383386
);
384387
path = Common;
385388
sourceTree = "<group>";
@@ -919,6 +922,7 @@
919922
CA9FF84E2595079F00E47BAF /* ScrollingTextView.swift in Sources */,
920923
E832EAF82B0FBCF4001B570D /* RuntimeInstallationStepDetailView.swift in Sources */,
921924
CABFA9C12592EEEA00380FEE /* Version+.swift in Sources */,
925+
BDBAB7452B9FF55800694B0B /* TrailingIconLabelStyle.swift in Sources */,
922926
E8D655C0288DD04700A139C2 /* SelectedActionType.swift in Sources */,
923927
36741BFD291E4FDB00A85AAE /* DownloadPreferencePane.swift in Sources */,
924928
E84E4F542B333864003F3959 /* PlatformsListView.swift in Sources */,

Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct NavigationSplitViewWrapper<Sidebar, Detail>: View where Sidebar: View, De
2323
NavigationSplitView {
2424
if #available(macOS 14, *) {
2525
sidebar
26-
.navigationSplitViewColumnWidth(min: 250, ideal: 300)
26+
.navigationSplitViewColumnWidth(min: 290, ideal: 290)
2727
} else {
2828
sidebar
2929
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// TrailingIconLabelStyle.swift
3+
// Xcodes
4+
//
5+
// Created by Daniel Chick on 3/11/24.
6+
// Copyright © 2024 Robots and Pencils. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
struct TrailingIconLabelStyle: LabelStyle {
12+
func makeBody(configuration: Configuration) -> some View {
13+
HStack {
14+
configuration.title
15+
configuration.icon
16+
}
17+
}
18+
}
19+
20+
extension LabelStyle where Self == TrailingIconLabelStyle {
21+
static var trailingIcon: Self { Self() }
22+
}

Xcodes/Frontend/MainWindow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct MainWindow: View {
1616
@AppStorage("isShowingInfoPane") private var isShowingInfoPane = false
1717
@AppStorage("xcodeListCategory") private var category: XcodeListCategory = .all
1818
@AppStorage("isInstalledOnly") private var isInstalledOnly = false
19-
19+
2020
var body: some View {
2121
NavigationSplitViewWrapper {
2222
XcodeListView(selectedXcodeID: $selectedXcodeID, searchText: searchText, category: category, isInstalledOnly: isInstalledOnly)

Xcodes/Frontend/XcodeList/MainToolbar.swift

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ struct MainToolbarModifier: ViewModifier {
55
@Binding var category: XcodeListCategory
66
@Binding var isInstalledOnly: Bool
77
@Binding var isShowingInfoPane: Bool
8-
8+
99
func body(content: Content) -> some View {
1010
content
1111
.toolbar { toolbar }
1212
}
1313

1414
private var toolbar: some ToolbarContent {
1515
ToolbarItemGroup {
16-
1716
ProgressButton(
18-
isInProgress: appState.isUpdating,
17+
isInProgress: appState.isUpdating,
1918
action: appState.update
2019
) {
2120
Label("Refresh", systemImage: "arrow.clockwise")
2221
}
2322
.keyboardShortcut(KeyEquivalent("r"))
2423
.help("RefreshDescription")
2524
Spacer()
25+
2626
Button(action: {
2727
switch category {
2828
case .all: category = .release
@@ -34,29 +34,17 @@ struct MainToolbarModifier: ViewModifier {
3434
case .all:
3535
Label("All", systemImage: "line.horizontal.3.decrease.circle")
3636
case .release:
37-
if #available(macOS 11.3, *) {
38-
Label("ReleaseOnly", systemImage: "line.horizontal.3.decrease.circle.fill")
39-
.labelStyle(TitleAndIconLabelStyle())
40-
.foregroundColor(.accentColor)
41-
} else {
4237
Label("ReleaseOnly", systemImage: "line.horizontal.3.decrease.circle.fill")
43-
.labelStyle(TitleOnlyLabelStyle())
38+
.labelStyle(.trailingIcon)
4439
.foregroundColor(.accentColor)
45-
}
4640
case .beta:
47-
if #available(macOS 11.3, *) {
48-
Label("BetaOnly", systemImage: "line.horizontal.3.decrease.circle.fill")
49-
.labelStyle(TitleAndIconLabelStyle())
50-
.foregroundColor(.accentColor)
51-
} else {
52-
Label("BetaOnly", systemImage: "line.horizontal.3.decrease.circle.fill")
53-
.labelStyle(TitleOnlyLabelStyle())
54-
.foregroundColor(.accentColor)
55-
}
41+
Label("BetaOnly", systemImage: "line.horizontal.3.decrease.circle.fill")
42+
.labelStyle(.trailingIcon)
43+
.foregroundColor(.accentColor)
5644
}
5745
}
5846
.help("FilterAvailableDescription")
59-
47+
6048
Button(action: {
6149
isInstalledOnly.toggle()
6250
}) {
@@ -65,11 +53,9 @@ struct MainToolbarModifier: ViewModifier {
6553
.foregroundColor(.accentColor)
6654
} else {
6755
Label("Filter", systemImage: "arrow.down.app")
68-
6956
}
7057
}
7158
.help("FilterInstalledDescription")
72-
7359
}
7460
}
7561
}
@@ -80,7 +66,7 @@ extension View {
8066
isInstalledOnly: Binding<Bool>,
8167
isShowingInfoPane: Binding<Bool>
8268
) -> some View {
83-
self.modifier(
69+
modifier(
8470
MainToolbarModifier(
8571
category: category,
8672
isInstalledOnly: isInstalledOnly,

Xcodes/Frontend/XcodeList/XcodeListView.swift

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ struct XcodeListView: View {
4545
.listStyle(.sidebar)
4646
.safeAreaInset(edge: .bottom, spacing: 0) {
4747
PlatformsPocket()
48-
.padding()
48+
.padding(.horizontal)
49+
.padding(.vertical, 8)
4950
}
5051
}
5152
}
@@ -54,19 +55,21 @@ struct PlatformsPocket: View {
5455
@SwiftUI.Environment(\.openWindow) private var openWindow
5556

5657
var body: some View {
57-
Button(action: {
58-
openWindow(id: "platforms") }
58+
Button(action: {
59+
openWindow(id: "platforms")
60+
}
5961
) {
60-
VStack(spacing: 5) {
62+
HStack(spacing: 5) {
6163
Image(systemName: "square.3.layers.3d")
62-
.font(.title)
63-
Text("Platforms")
64-
.font(.callout)
64+
.font(.title3.weight(.medium))
65+
Text("PlatformsDescription")
6566
}
66-
.frame(width: 70, height: 70)
67-
.background(.quaternary)
68-
.clipShape(RoundedRectangle(cornerRadius: 5, style: .continuous))
69-
67+
.font(.body.weight(.medium))
68+
.padding(.horizontal)
69+
.padding(.vertical, 12)
70+
.frame(maxWidth: .infinity, alignment: .leading)
71+
.background(.quaternary.opacity(0.75))
72+
.clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous))
7073
}
7174
.buttonStyle(.plain)
7275
}

Xcodes/Frontend/XcodeList/XcodeListViewRow.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ struct XcodeListViewRow: View {
3030
Text(verbatim: path.string)
3131
.font(.caption)
3232
.foregroundColor(.secondary)
33-
} else {
34-
Text(verbatim: "")
35-
.font(.caption)
3633
}
3734
}
3835

@@ -42,6 +39,7 @@ struct XcodeListViewRow: View {
4239
.padding(.trailing, 16)
4340
installControl(for: xcode)
4441
}
42+
.padding(.vertical, 4)
4543
.contextMenu {
4644
switch xcode.installState {
4745
case .notInstalled:
@@ -75,9 +73,10 @@ struct XcodeListViewRow: View {
7573
if let icon = xcode.icon {
7674
Image(nsImage: icon)
7775
} else {
78-
Color.clear
76+
Image(xcode.version.isPrerelease ? "xcode-beta" : "xcode")
77+
.resizable()
7978
.frame(width: 32, height: 32)
80-
.foregroundColor(.secondary)
79+
.opacity(0.2)
8180
}
8281
}
8382

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Image.png",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
82.4 KB
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "xcode.png",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}

0 commit comments

Comments
 (0)