@@ -89,14 +89,6 @@ private struct POSButton: View {
8989 private var progressView : some View {
9090 ProgressView ( )
9191 . progressViewStyle ( POSButtonProgressViewStyle ( size: size. progressViewDimensions. size, lineWidth: size. progressViewDimensions. lineWidth) )
92- . padding (
93- . init(
94- top: size. additionalPadding. vertical,
95- leading: size. additionalPadding. horizontal,
96- bottom: size. additionalPadding. vertical,
97- trailing: size. additionalPadding. horizontal
98- )
99- )
10092 }
10193
10294 private var backgroundColor : Color {
@@ -173,24 +165,14 @@ private extension POSButtonSize {
173165 ( size: 20 , lineWidth: 6 )
174166 }
175167 }
176-
177- /// The internal use of `IndefiniteCircularProgressViewStyle` progress style results in half of the line width drawn outside of the progress view.
178- /// This additional padding is thus adjusted by the partial line width to achieve the expected padding in design.
179- var additionalPadding : ( vertical: CGFloat , horizontal: CGFloat ) {
180- switch self {
181- case . normal:
182- ( vertical: progressViewDimensions. lineWidth * 0.5 , horizontal: progressViewDimensions. lineWidth * 0.5 )
183- case . extraSmall:
184- ( vertical: 2 + progressViewDimensions. lineWidth * 0.5 , horizontal: 16 + progressViewDimensions. lineWidth * 0.5 )
185- }
186- }
187168}
188169
189170// MARK: - Preview
190171
191172#if DEBUG
192173
193174struct POSButtonStyle_Previews : View {
175+ @State private var showsLoadingState : Bool = false
194176 var body : some View {
195177 ScrollView {
196178 VStack ( alignment: . leading, spacing: POSSpacing . xLarge) {
@@ -255,6 +237,11 @@ struct POSButtonStyle_Previews: View {
255237 Text ( title)
256238 . font ( . headline)
257239
240+ Button ( " Show loading state " ) {
241+ showsLoadingState. toggle ( )
242+ }
243+ . buttonStyle ( POSFilledButtonStyle ( size: size, isLoading: showsLoadingState) )
244+
258245 Button ( " Enabled Loading Button " ) { }
259246 . buttonStyle ( POSFilledButtonStyle ( size: size, isLoading: true ) )
260247
0 commit comments