Convert iCloud settings to macOS-native helpers

Add FixedIconWidthLabelStyle so sync category labels align when icons
have varying glyph widths.
This commit is contained in:
Arkadiusz Fal
2026-04-21 00:36:10 +02:00
parent f173dd1c39
commit 72778870e1
2 changed files with 24 additions and 16 deletions

View File

@@ -134,6 +134,21 @@ struct SettingsFormSection<Content: View>: View {
#endif
}
/// A label style that forces the icon to a fixed width so adjacent
/// labels align regardless of icon glyph width. Use when a section has
/// a vertical stack of `Label`s with mixed-width SF Symbols.
struct FixedIconWidthLabelStyle: LabelStyle {
var iconWidth: CGFloat = 22
func makeBody(configuration: Configuration) -> some View {
HStack(spacing: 8) {
configuration.icon
.frame(width: iconWidth, alignment: .center)
configuration.title
}
}
}
/// A settings row that pushes a destination view onto the navigation stack.
///
/// On macOS it renders as a plain full-width list row with a trailing