mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 14:22:02 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user