File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Sources/ComponentsKit/ProgressBar Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ public struct ProgressBarVM: ComponentVM {
3737 /// The angle of the stripes in the `.striped` progress bar style..
3838 public var stripeAngle : Angle = . degrees( 135 )
3939
40+ /// The padding applied to the modal's content area.
41+ ///
42+ /// Defaults to a padding value of `3` for all sides.
43+ public var contentPaddings : Paddings = . init( padding: 3 )
44+
4045 /// Initializes a new instance of `ProgressBarVM` with default values.
4146 public init ( ) { }
4247}
Original file line number Diff line number Diff line change @@ -49,8 +49,8 @@ public struct SUProgressBar: View {
4949 RoundedRectangle ( cornerRadius: self . model. computedCornerRadius)
5050 . foregroundStyle ( ( self . model. color. contrast ?? . foreground) . color)
5151 . frame ( width: ( geometry. size. width - 6 ) * self . fraction, height: self . model. barHeight - 6 )
52- . padding ( 3 )
53- . scaleEffect ( self . fraction == 0 ? 0 : 1 , anchor : . leading )
52+ . padding ( . vertical , self . model . contentPaddings . top )
53+ . padding ( . horizontal , self . model . contentPaddings . trailing )
5454 }
5555 . animation ( . spring, value: self . fraction)
5656
@@ -63,7 +63,8 @@ public struct SUProgressBar: View {
6363 RoundedRectangle ( cornerRadius: self . model. computedCornerRadius)
6464 . foregroundStyle ( self . model. color. contrast. color)
6565 . frame ( width: ( geometry. size. width - 6 ) * self . fraction, height: self . model. barHeight - 6 )
66- . padding ( 3 )
66+ . padding ( . vertical, self . model. contentPaddings. top)
67+ . padding ( . horizontal, self . model. contentPaddings. trailing)
6768
6869 StripesShape ( model: self . model)
6970 . foregroundStyle ( self . model. color. main. color)
You can’t perform that action at this time.
0 commit comments