Update ListRowLabel with the correct icon spacing when using LiquidGlass.

This commit is contained in:
Doug
2026-06-02 17:41:05 +01:00
committed by Stefan Ceriu
parent 4c8becc99e
commit 915b1fb718
300 changed files with 597 additions and 595 deletions
@@ -30,6 +30,8 @@ public enum ListRowPadding {
leading: horizontal,
bottom: 11,
trailing: horizontal)
public static let labelIconSpacing: CGFloat = Compound.supportsGlass ? 12 : 16
}
public struct ListRow<Icon: View, DetailsIcon: View, CustomContent: View, SelectionValue: Hashable>: View {
@@ -15,7 +15,7 @@ struct ListRowLabelStyle: LabelStyle {
let iconAlignment: VerticalAlignment
func makeBody(configuration: Configuration) -> some View {
HStack(alignment: iconAlignment, spacing: 16) {
HStack(alignment: iconAlignment, spacing: ListRowPadding.labelIconSpacing) {
configuration.icon
configuration.title
}
@@ -39,7 +39,7 @@ struct ListRowAvatarLabelStyle: LabelStyle {
@ScaledMetric private var avatarSize = 32.0
func makeBody(configuration: Configuration) -> some View {
HStack(alignment: .center, spacing: 16) {
HStack(alignment: .center, spacing: ListRowPadding.labelIconSpacing) {
configuration.icon
.frame(width: avatarSize, height: avatarSize)
.padding(.vertical, -5) // Don't allow the avatar to size the row.