@@ -22,60 +22,44 @@ struct MainToolbarModifier: ViewModifier {
2222 }
2323 . keyboardShortcut ( KeyEquivalent ( " r " ) )
2424 . help ( " RefreshDescription " )
25+
2526 Spacer ( )
26-
27- Button ( action: {
28- switch architectures {
29- case . universal: architectures = . appleSilicon
30- case . appleSilicon: architectures = . universal
31- }
32- } ) {
33- switch architectures {
34- case . universal:
35- Label ( " Universal " , systemImage: " cpu.fill " )
36- case . appleSilicon:
37- Label ( " Apple Silicon " , systemImage: " m4.button.horizontal " )
38- . labelStyle ( . trailingIcon)
39- . foregroundColor ( . accentColor)
40- }
41- }
42- . help ( " FilterAvailableDescription " )
43- . disabled ( architectures. isManaged)
4427
45- Button ( action: {
46- switch category {
47- case . all: category = . release
48- case . release: category = . beta
49- case . beta: category = . all
28+ let isFiltering = isInstalledOnly || category != . all || architectures != . universal
29+ Menu ( " Filter " , systemImage: " line.horizontal.3.decrease.circle " ) {
30+ Section {
31+ Toggle ( " Installed Only " , isOn: $isInstalledOnly)
5032 }
51- } ) {
52- switch category {
53- case . all:
54- Label ( " All " , systemImage: " line.horizontal.3.decrease.circle " )
55- case . release:
33+ . help ( " FilterInstalledDescription " )
34+
35+ Section {
36+ Picker ( " Category " , selection: $category) {
37+ Label ( " All " , systemImage: " line.horizontal.3.decrease.circle " )
38+ . tag ( XcodeListCategory . all)
5639 Label ( " ReleaseOnly " , systemImage: " line.horizontal.3.decrease.circle.fill " )
57- . labelStyle ( . trailingIcon)
58- . foregroundColor ( . accentColor)
59- case . beta:
60- Label ( " BetaOnly " , systemImage: " line.horizontal.3.decrease.circle.fill " )
61- . labelStyle ( . trailingIcon)
62- . foregroundColor ( . accentColor)
40+ . tag ( XcodeListCategory . release)
41+ Label ( " BetaOnly " , systemImage: " line.horizontal.3.decrease.circle.fill " )
42+ . tag ( XcodeListCategory . beta)
43+ }
6344 }
64- }
65- . help ( " FilterAvailableDescription " )
66- . disabled ( category. isManaged)
67-
68- Button ( action: {
69- isInstalledOnly. toggle ( )
70- } ) {
71- if isInstalledOnly {
72- Label ( " Filter " , systemImage: " arrow.down.app.fill " )
73- . foregroundColor ( . accentColor)
74- } else {
75- Label ( " Filter " , systemImage: " arrow.down.app " )
45+ . help ( " FilterAvailableDescription " )
46+ . disabled ( category. isManaged)
47+
48+ Section {
49+ Picker ( " Architecture " , selection: $architectures) {
50+ Label ( " Universal " , systemImage: " cpu.fill " )
51+ . tag ( XcodeListArchitecture . universal)
52+ Label ( " Apple Silicon " , systemImage: " m4.button.horizontal " )
53+ . foregroundColor ( . accentColor)
54+ . tag ( XcodeListArchitecture . appleSilicon)
55+ }
56+ . help ( " FilterArchitecturesDescription " )
57+ . disabled ( architectures. isManaged)
7658 }
59+ . labelStyle ( . trailingIcon)
7760 }
78- . help ( " FilterInstalledDescription " )
61+ . pickerStyle ( . inline)
62+ . symbolVariant ( isFiltering ? . fill : . none)
7963 }
8064 }
8165}
0 commit comments