Skip to content

Commit 805f754

Browse files
committed
Move platforms list view to it's own window, outside of settings
1 parent b968149 commit 805f754

5 files changed

Lines changed: 35 additions & 33 deletions

File tree

Xcodes.xcodeproj/project.pbxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@
10831083
"$(inherited)",
10841084
"@executable_path/../Frameworks",
10851085
);
1086+
MACOSX_DEPLOYMENT_TARGET = 13.0;
10861087
MARKETING_VERSION = 1.10.0;
10871088
PRODUCT_BUNDLE_IDENTIFIER = com.xcodesorg.xcodesapp;
10881089
PRODUCT_NAME = Xcodes;
@@ -1326,6 +1327,7 @@
13261327
"$(inherited)",
13271328
"@executable_path/../Frameworks",
13281329
);
1330+
MACOSX_DEPLOYMENT_TARGET = 13.0;
13291331
MARKETING_VERSION = 1.10.0;
13301332
PRODUCT_BUNDLE_IDENTIFIER = com.xcodesorg.xcodesapp;
13311333
PRODUCT_NAME = Xcodes;
@@ -1350,6 +1352,7 @@
13501352
"$(inherited)",
13511353
"@executable_path/../Frameworks",
13521354
);
1355+
MACOSX_DEPLOYMENT_TARGET = 13.0;
13531356
MARKETING_VERSION = 1.10.0;
13541357
PRODUCT_BUNDLE_IDENTIFIER = com.xcodesorg.xcodesapp;
13551358
PRODUCT_NAME = Xcodes;

Xcodes/Frontend/MainWindow.swift

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,6 @@ struct MainWindow: View {
6969
}
7070
}
7171
}
72-
73-
// HSplitView {
74-
// XcodeListView(selectedXcodeID: $selectedXcodeID, searchText: searchText, category: category, isInstalledOnly: isInstalledOnly)
75-
// .frame(minWidth: 300)
76-
// .layoutPriority(1)
77-
// .alert(item: $appState.xcodeBeingConfirmedForUninstallation) { xcode in
78-
// Alert(title: Text(String(format: localizeString("Alert.Uninstall.Title"), xcode.description)),
79-
// message: Text("Alert.Uninstall.Message"),
80-
// primaryButton: .destructive(Text("Uninstall"), action: { self.appState.uninstall(xcode: xcode) }),
81-
// secondaryButton: .cancel(Text("Cancel")))
82-
// }
83-
// .searchable(text: $searchText)
84-
//
85-
// if isShowingInfoPane {
86-
// Group {
87-
// if let xcode = xcode {
88-
// InfoPane(xcode: xcode)
89-
// } else {
90-
// UnselectedView()
91-
// }
92-
// }
93-
// .padding()
94-
// .frame(minWidth: 300, maxWidth: .infinity)
95-
// }
96-
// }
97-
9872
.bottomStatusBar()
9973
.padding([.top], 0)
10074
.navigationSubtitle(subtitleText)

Xcodes/Frontend/Preferences/PreferencesView.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import SwiftUI
22

33
struct PreferencesView: View {
44
private enum Tabs: Hashable {
5-
case general, updates, platforms, advanced, experiment
5+
case general, updates, advanced, experiment
66
}
77
@EnvironmentObject var appState: AppState
88
@EnvironmentObject var updater: ObservableUpdater
@@ -26,12 +26,6 @@ struct PreferencesView: View {
2626
.tabItem {
2727
Label("Downloads", systemImage: "icloud.and.arrow.down")
2828
}
29-
PlatformsListView()
30-
.environmentObject(appState)
31-
.tabItem {
32-
Label("Platforms", systemImage: "ipad.and.iphone")
33-
}
34-
.tag(Tabs.platforms)
3529
AdvancedPreferencePane()
3630
.environmentObject(appState)
3731
.tabItem {

Xcodes/Frontend/XcodeList/XcodeListView.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,32 @@ struct XcodeListView: View {
4343
XcodeListViewRow(xcode: xcode, selected: selectedXcodeID == xcode.id, appState: appState)
4444
}
4545
.listStyle(.sidebar)
46+
.safeAreaInset(edge: .bottom, spacing: 10) {
47+
PlatformsPocket()
48+
.padding()
49+
}
50+
}
51+
}
52+
53+
struct PlatformsPocket: View {
54+
@SwiftUI.Environment(\.openWindow) private var openWindow
55+
56+
var body: some View {
57+
Button(action: {
58+
openWindow(id: "platforms") }
59+
) {
60+
VStack(spacing: 5) {
61+
Image(systemName: "square.3.layers.3d")
62+
.font(.largeTitle)
63+
Text("Platforms")
64+
.font(.callout)
65+
}
66+
.frame(width: 100, height: 75)
67+
.background(.quaternary)
68+
.clipShape(RoundedRectangle(cornerRadius: 5, style: .continuous))
69+
70+
}
71+
.buttonStyle(.plain)
4672
}
4773
}
4874

Xcodes/XcodesApp.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ struct XcodesApp: App {
7777
alert(for: presentedAlert)
7878
})
7979
}
80+
81+
Window("Platforms", id: "platforms") {
82+
PlatformsListView()
83+
.environmentObject(appState)
84+
}
8085
#endif
8186
}
8287

0 commit comments

Comments
 (0)