From ffcb73fe33f0a6c2eb877ea35e36d3cc08cdc60f Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Wed, 8 Jul 2026 23:43:02 +0200 Subject: [PATCH] Strengthen top bar scrim gradient on macOS player controls --- .../macOS/MacOSPlayerControlsView.swift | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/Yattee/Views/Player/macOS/MacOSPlayerControlsView.swift b/Yattee/Views/Player/macOS/MacOSPlayerControlsView.swift index 835d09ed..828617a8 100644 --- a/Yattee/Views/Player/macOS/MacOSPlayerControlsView.swift +++ b/Yattee/Views/Player/macOS/MacOSPlayerControlsView.swift @@ -155,11 +155,11 @@ struct MacOSPlayerControlsView: View { .padding(.bottom, 24) .frame(maxWidth: .infinity, alignment: .leading) .background( - LinearGradient( - colors: [.black.opacity(0.55), .clear], - startPoint: .top, endPoint: .bottom - ) - .allowsHitTesting(false) + topBarScrim + // Extend the scrim past the bar's bottom edge so the fade has + // more room and doesn't end right under the title text. + .padding(.bottom, -24) + .allowsHitTesting(false) ) .background( TrafficLightInsetReader(inset: $trafficLightInset) @@ -167,6 +167,29 @@ struct MacOSPlayerControlsView: View { ) } + /// Alpha ramp shared by both scrim variants: multi-stop eased fade so the + /// scrim has no visible hard edge where it ends. + private func scrimGradient(maxOpacity: Double) -> LinearGradient { + LinearGradient( + stops: [ + .init(color: .black.opacity(maxOpacity), location: 0), + .init(color: .black.opacity(maxOpacity * 0.8), location: 0.35), + .init(color: .black.opacity(maxOpacity * 0.45), location: 0.65), + .init(color: .black.opacity(maxOpacity * 0.15), location: 0.85), + .init(color: .clear, location: 1), + ], + startPoint: .top, endPoint: .bottom + ) + } + + /// Background behind the top bar keeping the title/author legible over the + /// video. A gradient-masked Liquid Glass strip was tried on macOS 26 but + /// rendered poorly over the video layer, so the dimming gradient is used + /// on all versions. + private var topBarScrim: some View { + scrimGradient(maxOpacity: 0.75) + } + // MARK: - Actions /// Consolidated actions for the section renderers.