Make sources list feel native on macOS

Drop the iOS-grouped rounded card, per-row chevron, and oversized
metrics on macOS. Use tighter padding, smaller icon/title fonts,
uppercase section headers, and top/bottom dividers so the list reads
like a native grouped Mac list. Force .buttonStyle(.plain) on row
buttons/NavigationLinks and add .contentShape(Rectangle()) so the
full row is hit-testable without picking up macOS's default link
styling. iOS and tvOS unchanged.
This commit is contained in:
Arkadiusz Fal
2026-04-20 21:07:05 +02:00
parent 267f770274
commit d8f10e984a
3 changed files with 136 additions and 12 deletions

View File

@@ -17,13 +17,25 @@ struct SourceListRow<Content: View>: View {
@ViewBuilder let content: () -> Content
/// Horizontal padding for row content.
#if os(macOS)
private let horizontalPadding: CGFloat = 12
#else
private let horizontalPadding: CGFloat = 16
#endif
/// Vertical padding for row content.
#if os(macOS)
private let verticalPadding: CGFloat = 8
#else
private let verticalPadding: CGFloat = 12
#endif
/// Width of the icon column.
#if os(macOS)
private let iconWidth: CGFloat = 24
#else
private let iconWidth: CGFloat = 32
#endif
/// Spacing between icon and text.
private let iconTextSpacing: CGFloat = 12