File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed
Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -93,10 +93,10 @@ private struct ScrollViewOffsetTracker: UIViewRepresentable {
9393
9494extension View {
9595 @ViewBuilder
96- func adaptiveButtonStyle(
97- shape: some Shape = . capsule ,
98- color: Color = . clear)
99- -> some View {
96+ func adaptiveButtonStyle< S : InsettableShape > (
97+ shape: S = Capsule ( ) ,
98+ color: Color = . clear
99+ ) -> some View {
100100 if #available( iOS 26 . 0 , * ) {
101101 self . foregroundStyle ( Color ( . label) )
102102 . padding ( 8 )
@@ -106,19 +106,9 @@ extension View {
106106 self . foregroundStyle ( Color ( . label) )
107107 . padding ( 8 )
108108 . background {
109- Group {
110- if color == . clear {
111- shape
112- . fill ( Color ( . systemGray5) )
113- } else {
114- shape
115- . fill ( color)
116- }
117- }
118- . overlay {
119- shape
120- . stroke ( Color . white. opacity ( 0.2 ) , lineWidth: 1 )
121- }
109+ shape
110+ . fill ( color == . clear ? Color ( . systemGray5) : color)
111+ . strokeBorder ( Color . white. opacity ( 0.2 ) , lineWidth: 1 )
122112 }
123113 }
124114 }
You can’t perform that action at this time.
0 commit comments