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
@@ -45,7 +45,6 @@ struct CreateRoomScreen: View {
.alert(item: $context.alertInfo)
}
@ScaledMetric private var roomIconSize: CGFloat = 70
private var roomSection: some View {
Section {
HStack(alignment: .center, spacing: 16) {
@@ -61,7 +60,7 @@ struct CreateRoomScreen: View {
} placeholder: {
ProgressView()
}
.frame(width: roomIconSize, height: roomIconSize)
.scaledFrame(size: 70)
.clipShape(Circle())
} else {
cameraImage
@@ -106,7 +105,7 @@ struct CreateRoomScreen: View {
Image(systemName: "camera")
.font(.system(size: 28, weight: .semibold))
.foregroundColor(.compound.iconSecondary)
.frame(width: roomIconSize, height: roomIconSize)
.scaledFrame(size: 70)
.background(Color.compound.bgSubtlePrimary)
.clipShape(Circle())
}