Add scaledFrame/scaledPadding APIs (#2079)

* Add scaled frame and padding modifiers

* Refactor AppLockScreen

* Refactor FormattingToolbar

* Refactor RoomAttachmentPicker

* Refactor ComposerToolbar

* Refactor VoiceMessageRecordingButton

* More refactors

* Refine ScaledPaddingModifier

* Cleanup

* Fix preview tests

* Fix preview test

* Use CompoundIcon for custom image

* Add .scaledFrame(size:) overload

* Set fallback style to .body
This commit is contained in:
Alfonso Grillo
2023-11-14 12:20:34 +01:00
committed by GitHub
parent 4257c20bc9
commit 752ad66397
43 changed files with 172 additions and 121 deletions
@@ -104,7 +104,6 @@ struct StaticLocationScreen: View {
context.viewState.isLocationPickerMode ? .horizontal : [.horizontal, .bottom]
}
@ScaledMetric private var shareMarkerSize: CGFloat = 28
private var selectLocationButton: some View {
Button {
context.send(viewAction: .selectLocation)
@@ -113,7 +112,7 @@ struct StaticLocationScreen: View {
Image(asset: Asset.Images.locationMarker)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: shareMarkerSize, height: shareMarkerSize)
.scaledFrame(size: 28)
Text(context.viewState.isSharingUserLocation ? L10n.screenShareMyLocationAction : L10n.screenShareThisLocationAction)
}
}