From e58bfae519bce81c3ee35bef83351933fbe50d5f Mon Sep 17 00:00:00 2001 From: Daniel Kennett Date: Sun, 12 Oct 2025 01:19:11 +0200 Subject: [PATCH] Fix dismiss button appearance on Mac, fix logic for whether to show tab indicators or not (#24) * Add .buttonStyle(.borderless) to dismiss button to fix Mac appearance * Show tab page indicators if there's a leading or trailing view --- Sources/Recap/Public/RecapScreen.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/Recap/Public/RecapScreen.swift b/Sources/Recap/Public/RecapScreen.swift index 4e1fbfa..9f7470b 100644 --- a/Sources/Recap/Public/RecapScreen.swift +++ b/Sources/Recap/Public/RecapScreen.swift @@ -61,7 +61,7 @@ public struct RecapScreen: View { self.trailingView .tag(self.tabIndex(from: .trailingView)) } - .tabViewStyle(.page(indexDisplayMode: self.releases.count > 1 ? .always : .never)) + .tabViewStyle(.page(indexDisplayMode: self.hasMultiplePages ? .always : .never)) .background(self.derivedBackgroundStyle) Button(action: { @@ -82,6 +82,7 @@ public struct RecapScreen: View { .contentShape(.rect(cornerRadius: 16.0)) }) .frame(maxWidth: .infinity) + .buttonStyle(.borderless) .background(self.dismissButtonStyle.backgroundStyle) .versionSpecificClipShape() .padding(.horizontal, 40.0) @@ -134,6 +135,12 @@ private extension RecapScreen { self.releases.reversed() } + var hasMultiplePages: Bool { + let hasLeading: Bool = (LeadingView.self != EmptyView.self) + let hasTrailing: Bool = (TrailingView.self != EmptyView.self) + return hasLeading || hasTrailing || self.releases.count > 1 + } + var derivedBackgroundStyle: AnyShapeStyle { if let backgroundStyle { backgroundStyle -- 2.51.2