From 192a1c6371858949c368a44b108240deb9708fef Mon Sep 17 00:00:00 2001 From: Brandon Evans Date: Sun, 27 Dec 2020 23:25:26 -0700 Subject: [PATCH] Move all toolbar items to status position, use filter button instead of picker --- Xcodes/Frontend/XcodeList/XcodeListView.swift | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Xcodes/Frontend/XcodeList/XcodeListView.swift b/Xcodes/Frontend/XcodeList/XcodeListView.swift index d10eb8a..04a6eb4 100644 --- a/Xcodes/Frontend/XcodeList/XcodeListView.swift +++ b/Xcodes/Frontend/XcodeList/XcodeListView.swift @@ -81,7 +81,7 @@ struct XcodeListView: View { } } .toolbar { - ToolbarItemGroup(placement: .primaryAction) { + ToolbarItemGroup(placement: .status) { Button(action: appState.update) { Label("Refresh", systemImage: "arrow.clockwise") } @@ -93,16 +93,22 @@ struct XcodeListView: View { .scaleEffect(0.5, anchor: .center) .isHidden(!appState.isUpdating) ) - } - ToolbarItem(placement: .principal) { - Picker("", selection: $category) { - ForEach(Category.allCases, id: \.self) { - Text($0.description).tag($0) + + Button(action: { + switch category { + case .all: category = .installed + case .installed: category = .all + } + }) { + switch category { + case .all: + Label("Filter", systemImage: "line.horizontal.3.decrease.circle") + case .installed: + Label("Filter", systemImage: "line.horizontal.3.decrease.circle.fill") + .foregroundColor(.accentColor) } } - .pickerStyle(SegmentedPickerStyle()) - } - ToolbarItem { + TextField("Search...", text: $searchText) .textFieldStyle(RoundedBorderTextFieldStyle()) .frame(width: 200)