Fix layout of multiline modules (#916)

- Align to .leading in multi-line
- Wrap profile rows into top/bottom spacers to adjust to tallest cell in
grid

See #915
This commit is contained in:
Davide 2024-11-22 13:44:06 +01:00 committed by GitHub
parent fb0d1abc8a
commit bd237c4a6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 15 deletions

View File

@ -51,6 +51,7 @@ struct ProfileCardView: View {
.themeTruncating()
Text(preview.subtitle ?? Strings.Views.Profiles.Rows.noModules)
.multilineTextAlignment(.leading)
.font(.subheadline)
.foregroundStyle(.secondary)
}

View File

@ -54,24 +54,28 @@ struct ProfileRowView: View, Routable {
var flow: ProfileFlow?
var body: some View {
HStack {
Group {
if withMarker {
markerView
VStack(spacing: .zero) {
Spacer(minLength: .zero)
HStack {
Group {
if withMarker {
markerView
}
cardView
}
cardView
}
Spacer()
HStack(spacing: 10.0) {
ProfileAttributesView(
attributes: attributes,
isRemoteImportingEnabled: profileManager.isRemoteImportingEnabled
)
ProfileInfoButton(preview: preview) {
flow?.onEditProfile($0)
Spacer()
HStack(spacing: 10.0) {
ProfileAttributesView(
attributes: attributes,
isRemoteImportingEnabled: profileManager.isRemoteImportingEnabled
)
ProfileInfoButton(preview: preview) {
flow?.onEditProfile($0)
}
}
.imageScale(.large)
}
.imageScale(.large)
Spacer(minLength: .zero)
}
}
}