Skip to content

Commit

Permalink
Place PlatformsPocket back to XcodeListView
Browse files Browse the repository at this point in the history
  • Loading branch information
huihuisang committed Mar 10, 2024
1 parent 950045b commit 9a866ac
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Xcodes/Frontend/Common/NavigationSplitViewWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct NavigationSplitViewWrapper<Sidebar, Detail>: View where Sidebar: View, De

if #available(macOS 14, *) {
sidebar
.navigationSplitViewColumnWidth(min: 300, ideal: 300)
.navigationSplitViewColumnWidth(min: 290, ideal: 290)
} else {
sidebar
}
Expand Down
8 changes: 0 additions & 8 deletions Xcodes/Frontend/XcodeList/MainToolbar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ struct MainToolbarModifier: ViewModifier {
@Binding var category: XcodeListCategory
@Binding var isInstalledOnly: Bool
@Binding var isShowingInfoPane: Bool
@SwiftUI.Environment(\.openWindow) private var openWindow

func body(content: Content) -> some View {
content
Expand Down Expand Up @@ -69,13 +68,6 @@ struct MainToolbarModifier: ViewModifier {
}
}
.help("FilterInstalledDescription")

Button(action: {
openWindow(id: "platforms")
}) {
Label("Platforms", systemImage: "square.3.layers.3d")
}
.help("PlatformsDescription")
}
}
}
Expand Down
29 changes: 29 additions & 0 deletions Xcodes/Frontend/XcodeList/XcodeListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,35 @@ struct XcodeListView: View {
XcodeListViewRow(xcode: xcode, selected: selectedXcodeID == xcode.id, appState: appState)
}
.listStyle(.sidebar)
.safeAreaInset(edge: .bottom, spacing: 0) {
PlatformsPocket()
.padding(.horizontal)
.padding(.vertical, 8)
}
}
}

struct PlatformsPocket: View {
@SwiftUI.Environment(\.openWindow) private var openWindow

var body: some View {
Button(action: {
openWindow(id: "platforms")
}
) {
HStack(spacing: 5) {
Image(systemName: "square.3.layers.3d")
.font(.title3.weight(.medium))
Text("PlatformsDescription")
}
.font(.body.weight(.medium))
.padding(.horizontal)
.padding(.vertical, 12)
.frame(maxWidth: .infinity, alignment: .leading)
.background(.quaternary.opacity(0.75))
.clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous))
}
.buttonStyle(.plain)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Xcodes/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -14467,7 +14467,7 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Installed platforms"
"value" : "Installed Platforms"
}
}
}
Expand Down

0 comments on commit 9a866ac

Please sign in to comment.