Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@ private struct MinimumTouchTarget: ViewModifier {

func body(content: Content) -> some View {
content
.buttonStyle(.plain)
.buttonStyle(MinimumTouchTargetButtonStyle())
.glassEffect(.regular.tint(selected ? selectedColor.opacity(0.3) : .clear).interactive(), in: .circle)
}
}

/// Expands the tappable area from inside the button so the full 44pt circle
/// receives taps — a `frame`/`contentShape` applied outside a `Button` only
/// resizes the visual glass, not the button's hit-test region (FB22155477).
private struct MinimumTouchTargetButtonStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.frame(width: 44, height: 44)
.contentShape(Circle())
.glassEffect(.regular.tint(selected ? selectedColor.opacity(0.3) : .clear).interactive(), in: .circle)
.opacity(configuration.isPressed ? 0.4 : 1)
}
}
Loading