mirror of
https://github.com/yattee/yattee.git
synced 2026-06-27 09:04:19 +00:00
Open queue sheet from tvOS player controls
Turn the tvOS bottom-row queue count indicator into a focusable button that opens QueueManagementSheet in a fullScreenCover with an ultraThinMaterial backdrop, matching the Settings sheet pattern. Hide the sheet's close toolbar button on tvOS (Menu button dismisses) and replace the unusable Menu-based queue mode picker with an icon-only tap-to-cycle button.
This commit is contained in:
@@ -18,6 +18,7 @@ enum TVPlayerFocusTarget: Hashable {
|
||||
case debugButton
|
||||
case playNext
|
||||
case closeButton
|
||||
case queueButton
|
||||
}
|
||||
|
||||
/// Main tvOS fullscreen player view.
|
||||
@@ -45,6 +46,9 @@ struct TVPlayerView: View {
|
||||
/// Whether the quality sheet is shown.
|
||||
@State private var showingQualitySheet = false
|
||||
|
||||
/// Whether the queue sheet is shown.
|
||||
@State private var showingQueueSheet = false
|
||||
|
||||
/// Whether the debug overlay is shown.
|
||||
@State private var isDebugOverlayVisible = false
|
||||
|
||||
@@ -109,6 +113,14 @@ struct TVPlayerView: View {
|
||||
.fullScreenCover(isPresented: $showingQualitySheet) {
|
||||
qualitySheetContent
|
||||
}
|
||||
.fullScreenCover(isPresented: $showingQueueSheet) {
|
||||
ZStack {
|
||||
Rectangle()
|
||||
.fill(.ultraThinMaterial)
|
||||
.ignoresSafeArea()
|
||||
QueueManagementSheet()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Quality Sheet Content
|
||||
@@ -195,6 +207,7 @@ struct TVPlayerView: View {
|
||||
playerService: playerService,
|
||||
focusedControl: $focusedControl,
|
||||
onShowSettings: { showQualitySheet() },
|
||||
onShowQueue: { showQueueSheet() },
|
||||
onShowDetails: { showDetailsPanel(tab: .info) },
|
||||
onShowComments: { showDetailsPanel(tab: .comments) },
|
||||
onShowDebug: { showDebugOverlay() },
|
||||
@@ -419,6 +432,11 @@ struct TVPlayerView: View {
|
||||
showingQualitySheet = true
|
||||
}
|
||||
|
||||
private func showQueueSheet() {
|
||||
stopControlsTimer()
|
||||
showingQueueSheet = true
|
||||
}
|
||||
|
||||
private func switchToStream(_ stream: Stream, audioStream: Stream? = nil) {
|
||||
guard let video = playerState?.currentVideo else { return }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user