mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Move all toolbar items to status position, use filter button instead of picker
This commit is contained in:
parent
e617fd2689
commit
192a1c6371
1 changed files with 15 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue