diff --git a/Xcodes/Frontend/MainWindow.swift b/Xcodes/Frontend/MainWindow.swift index 6bbe1ee..80d0e85 100644 --- a/Xcodes/Frontend/MainWindow.swift +++ b/Xcodes/Frontend/MainWindow.swift @@ -16,11 +16,11 @@ struct MainWindow: View { @AppStorage("isShowingInfoPane") private var isShowingInfoPane = false @AppStorage("xcodeListCategory") private var category: XcodeListCategory = .all @AppStorage("isInstalledOnly") private var isInstalledOnly = false - + var body: some View { NavigationSplitViewWrapper { XcodeListView(selectedXcodeID: $selectedXcodeID, searchText: searchText, category: category, isInstalledOnly: isInstalledOnly) - .frame(minWidth: 250) + .frame(minWidth: 260) .layoutPriority(1) .alert(item: $appState.xcodeBeingConfirmedForUninstallation) { xcode in Alert(title: Text(String(format: localizeString("Alert.Uninstall.Title"), xcode.description)), diff --git a/Xcodes/Frontend/XcodeList/MainToolbar.swift b/Xcodes/Frontend/XcodeList/MainToolbar.swift index c64c1dd..b2c7aea 100644 --- a/Xcodes/Frontend/XcodeList/MainToolbar.swift +++ b/Xcodes/Frontend/XcodeList/MainToolbar.swift @@ -5,7 +5,8 @@ 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 .toolbar { toolbar } @@ -13,9 +14,8 @@ struct MainToolbarModifier: ViewModifier { private var toolbar: some ToolbarContent { ToolbarItemGroup { - ProgressButton( - isInProgress: appState.isUpdating, + isInProgress: appState.isUpdating, action: appState.update ) { Label("Refresh", systemImage: "arrow.clockwise") @@ -23,6 +23,7 @@ struct MainToolbarModifier: ViewModifier { .keyboardShortcut(KeyEquivalent("r")) .help("RefreshDescription") Spacer() + Button(action: { switch category { case .all: category = .release @@ -56,7 +57,7 @@ struct MainToolbarModifier: ViewModifier { } } .help("FilterAvailableDescription") - + Button(action: { isInstalledOnly.toggle() }) { @@ -65,11 +66,16 @@ struct MainToolbarModifier: ViewModifier { .foregroundColor(.accentColor) } else { Label("Filter", systemImage: "arrow.down.app") - } } .help("FilterInstalledDescription") - + + Button(action: { + openWindow(id: "platforms") + }) { + Label("Platforms", systemImage: "square.3.layers.3d") + } + .help("PlatformsDescription") } } } @@ -80,7 +86,7 @@ extension View { isInstalledOnly: Binding, isShowingInfoPane: Binding ) -> some View { - self.modifier( + modifier( MainToolbarModifier( category: category, isInstalledOnly: isInstalledOnly, diff --git a/Xcodes/Frontend/XcodeList/XcodeListView.swift b/Xcodes/Frontend/XcodeList/XcodeListView.swift index d68936d..fdbdfc8 100644 --- a/Xcodes/Frontend/XcodeList/XcodeListView.swift +++ b/Xcodes/Frontend/XcodeList/XcodeListView.swift @@ -43,32 +43,6 @@ struct XcodeListView: View { XcodeListViewRow(xcode: xcode, selected: selectedXcodeID == xcode.id, appState: appState) } .listStyle(.sidebar) - .safeAreaInset(edge: .bottom, spacing: 0) { - PlatformsPocket() - .padding() - } - } -} - -struct PlatformsPocket: View { - @SwiftUI.Environment(\.openWindow) private var openWindow - - var body: some View { - Button(action: { - openWindow(id: "platforms") } - ) { - VStack(spacing: 5) { - Image(systemName: "square.3.layers.3d") - .font(.title) - Text("Platforms") - .font(.callout) - } - .frame(width: 70, height: 70) - .background(.quaternary) - .clipShape(RoundedRectangle(cornerRadius: 5, style: .continuous)) - - } - .buttonStyle(.plain) } } diff --git a/Xcodes/Frontend/XcodeList/XcodeListViewRow.swift b/Xcodes/Frontend/XcodeList/XcodeListViewRow.swift index 55f431c..6c51600 100644 --- a/Xcodes/Frontend/XcodeList/XcodeListViewRow.swift +++ b/Xcodes/Frontend/XcodeList/XcodeListViewRow.swift @@ -30,9 +30,6 @@ struct XcodeListViewRow: View { Text(verbatim: path.string) .font(.caption) .foregroundColor(.secondary) - } else { - Text(verbatim: "") - .font(.caption) } } @@ -42,6 +39,7 @@ struct XcodeListViewRow: View { .padding(.trailing, 16) installControl(for: xcode) } + .padding(.vertical, 4) .contextMenu { switch xcode.installState { case .notInstalled: @@ -75,9 +73,10 @@ struct XcodeListViewRow: View { if let icon = xcode.icon { Image(nsImage: icon) } else { - Color.clear + Image("xcode") + .resizable() .frame(width: 32, height: 32) - .foregroundColor(.secondary) + .opacity(0.2) } } diff --git a/Xcodes/Resources/Assets.xcassets/xcode.imageset/Contents.json b/Xcodes/Resources/Assets.xcassets/xcode.imageset/Contents.json new file mode 100644 index 0000000..4c2a7f7 --- /dev/null +++ b/Xcodes/Resources/Assets.xcassets/xcode.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "xcode.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Xcodes/Resources/Assets.xcassets/xcode.imageset/xcode.png b/Xcodes/Resources/Assets.xcassets/xcode.imageset/xcode.png new file mode 100644 index 0000000..d8b43ba Binary files /dev/null and b/Xcodes/Resources/Assets.xcassets/xcode.imageset/xcode.png differ diff --git a/Xcodes/Resources/Localizable.xcstrings b/Xcodes/Resources/Localizable.xcstrings index 74a637f..39005ef 100644 --- a/Xcodes/Resources/Localizable.xcstrings +++ b/Xcodes/Resources/Localizable.xcstrings @@ -14716,6 +14716,16 @@ } } }, + "PlatformsDescription" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Installed platforms" + } + } + } + }, "PlatformsList.Title" : { "extractionState" : "manual", "localizations" : {