@@ -71,52 +71,35 @@ struct FindBarView: View {
7171
7272 Divider ( ) . frame ( height : 14 )
7373
74- // Previous match
75- Button { navigateBackward ( ) } label : {
76- Image ( systemName : " chevron.up " )
77- . imageScale ( . small )
78- }
79- . buttonStyle ( . plain )
80- . disabled ( matches . isEmpty )
81- . help ( " Previous match (⇧↩) " )
82-
83- // Next match
84- Button { navigateForward ( ) } label : {
85- Image ( systemName : " chevron.down " )
86- . imageScale ( . small )
74+ GlassControlGroup {
75+ HStack ( spacing : 0 ) {
76+ AdaptiveIconButton (
77+ systemName : " chevron.up " ,
78+ help : " Previous match (⇧↩) " ,
79+ action : navigateBackward ,
80+ )
81+ . disabled ( matches . isEmpty )
82+
83+ AdaptiveIconButton (
84+ systemName : " chevron.down " ,
85+ help : " Next match (↩) " ,
86+ action : navigateForward ,
87+ )
88+ . disabled ( matches . isEmpty )
89+ }
8790 }
88- . buttonStyle ( . plain )
89- . disabled ( matches . isEmpty )
90- . help ( " Next match (↩) " )
9191
9292 Divider ( ) . frame ( height : 14 )
9393
94- // Case-sensitive toggle
95- Button {
96- caseSensitive . toggle ( )
97- } label : {
98- Text ( " Aa " )
99- . font ( . system ( size : 11 , weight : caseSensitive ? . bold : . regular ) )
100- . foregroundStyle ( caseSensitive ? . primary : . secondary )
101- . frame ( width : 22 , height : 18 )
102- . background (
103- caseSensitive
104- ? AnyView ( RoundedRectangle ( cornerRadius : 4 ) . fill ( . quaternary ) )
105- : AnyView ( EmptyView ( ) ) ,
106- )
107- }
108- . buttonStyle ( . plain )
109- . help ( l10n [ " find.caseSensitive " ] )
94+ caseSensitivityButton
11095
11196 Divider ( ) . frame ( height : 14 )
11297
113- // Close button
114- Button { dismiss ( ) } label : {
115- Image ( systemName : " xmark " )
116- . imageScale ( . small )
117- }
118- . buttonStyle ( . plain )
119- . help ( l10n [ " find.close " ] )
98+ AdaptiveIconButton (
99+ systemName : " xmark " ,
100+ help : l10n [ " find.close " ] ,
101+ action : dismiss ,
102+ )
120103 }
121104
122105 // Row 2: replace field + buttons
@@ -166,6 +149,44 @@ struct FindBarView: View {
166149 }
167150 }
168151
152+ @ ViewBuilder
153+ private var caseSensitivityButton : some View {
154+ if #available( macOS 26 . 0 , * ) {
155+ Button {
156+ caseSensitive . toggle ( )
157+ } label : {
158+ caseSensitivityLabel
159+ }
160+ . buttonStyle ( . glass )
161+ . help ( l10n [ " find.caseSensitive " ] )
162+ . accessibilityLabel ( l10n [ " find.caseSensitive " ] )
163+ } else {
164+ Button {
165+ caseSensitive . toggle ( )
166+ } label : {
167+ caseSensitivityLabel
168+ . background {
169+ RoundedRectangle ( cornerRadius : SurfaceMetrics . compactControlCornerRadius )
170+ . fill ( Color . primary . opacity ( caseSensitive ? 0.12 : 0 ) )
171+ }
172+ }
173+ . buttonStyle ( . plain )
174+ . help ( l10n [ " find.caseSensitive " ] )
175+ . accessibilityLabel ( l10n [ " find.caseSensitive " ] )
176+ }
177+ }
178+
179+ private var caseSensitivityLabel : some View {
180+ Text ( " Aa " )
181+ . font ( . system ( size : 11 , weight : caseSensitive ? . bold : . regular ) )
182+ . foregroundStyle ( caseSensitive ? Color . accentColor : . secondary )
183+ . frame (
184+ width : SurfaceMetrics . compactControlSize ,
185+ height : SurfaceMetrics . compactControlSize ,
186+ )
187+ . contentShape ( Rectangle ( ) )
188+ }
189+
169190 // MARK: - Match engine
170191
171192 private static func findMatches (
0 commit comments