@@ -7,6 +7,8 @@ extension EnvironmentValues {
77/// Coordinates nearby Liquid Glass controls on supported systems while
88/// preserving the same ordinary SwiftUI layout on older macOS releases.
99struct GlassControlGroup < Content : View > : View {
10+ @ Environment ( AppSettings . self ) private var appSettings
11+
1012 private let spacing : CGFloat ?
1113 private let content : Content
1214
@@ -19,38 +21,36 @@ struct GlassControlGroup<Content: View>: View {
1921 }
2022
2123 var body : some View {
22- if #available( macOS 26 . 0 , * ) {
24+ if #available( macOS 26 . 0 , * ) , appSettings . usesLiquidGlass {
2325 GlassEffectContainer ( spacing : spacing ) {
2426 content
2527 }
2628 . buttonBorderShape ( . roundedRectangle )
2729 } else {
28- content . buttonBorderShape ( . roundedRectangle )
30+ content
2931 }
3032 }
3133}
3234
3335/// Presents related panel toolbar actions as one Finder-style control island.
3436struct PanelToolbarGroup < Content : View > : View {
37+ @ Environment ( AppSettings . self ) private var appSettings
38+
3539 private let content : Content
3640
3741 init ( @ViewBuilder content : ( ) -> Content ) {
3842 self . content = content ( )
3943 }
4044
4145 var body : some View {
42- if #available( macOS 26 . 0 , * ) {
46+ if #available( macOS 26 . 0 , * ) , appSettings . usesLiquidGlass {
4347 groupContent
4448 . glassEffect ( . regular . interactive ( ) , in : ButtonBorderShape . roundedRectangle )
4549 . clipShape ( ButtonBorderShape . roundedRectangle )
4650 } else {
47- groupContent
48- . background ( . regularMaterial , in : ButtonBorderShape . roundedRectangle )
49- . overlay {
50- ButtonBorderShape . roundedRectangle
51- . strokeBorder ( . separator . opacity ( 0.45 ) , lineWidth : 0.5 )
52- }
53- . clipShape ( ButtonBorderShape . roundedRectangle )
51+ HStack ( spacing : SurfaceMetrics . controlGroupSpacing ) {
52+ content
53+ }
5454 }
5555 }
5656
0 commit comments