From 54488aea0fc0b2c264b8199756c229375be9efae Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sun, 24 May 2026 21:05:29 +0200 Subject: [PATCH] Keep macOS player transport buttons visible but disabled when unavailable The play-next and Picture-in-Picture buttons were folded into the view condition (hasNext / isPiPPossible), so they popped in and out of the control bar and shifted the surrounding layout. Always render them (when their callback is wired) and gate availability with .disabled() instead, mirroring the existing play-previous button. --- Yattee/Views/Player/macOS/MacOSControlBar.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Yattee/Views/Player/macOS/MacOSControlBar.swift b/Yattee/Views/Player/macOS/MacOSControlBar.swift index 246fd369..efcd1e60 100644 --- a/Yattee/Views/Player/macOS/MacOSControlBar.swift +++ b/Yattee/Views/Player/macOS/MacOSControlBar.swift @@ -180,8 +180,8 @@ struct MacOSControlBar: View { .disabled(isTransportDisabled) .opacity(isTransportDisabled ? 0.3 : 1.0) - // Play next (if queue has items) - if let onPlayNext, playerState.hasNext { + // Play next (disabled when no next in queue) + if let onPlayNext { Button { playNextTapCount += 1 Task { await onPlayNext() } @@ -193,6 +193,7 @@ struct MacOSControlBar: View { .symbolEffect(.bounce.down.byLayer, options: .nonRepeating, value: playNextTapCount) } .buttonStyle(MacOSControlButtonStyle()) + .disabled(!playerState.hasNext) } } } @@ -366,7 +367,7 @@ struct MacOSControlBar: View { } // PiP - if let onTogglePiP, playerState.isPiPPossible { + if let onTogglePiP { Button { onTogglePiP() } label: { @@ -376,6 +377,7 @@ struct MacOSControlBar: View { .contentShape(Rectangle()) } .buttonStyle(MacOSControlButtonStyle()) + .disabled(!playerState.isPiPPossible) } } }