Move close video button from toolbar into now playing card in RemoteControlView

This commit is contained in:
Arkadiusz Fal
2026-02-12 08:13:17 +01:00
parent 4f954b7c9c
commit a8c59e61cd

View File

@@ -185,18 +185,6 @@ struct RemoteControlView: View {
ToolbarItem(placement: .principal) { ToolbarItem(placement: .principal) {
deviceHeader deviceHeader
} }
ToolbarItem(placement: .primaryAction) {
Button(role: .destructive) {
Task {
await remoteControl?.closeVideo(on: device)
dismiss()
}
} label: {
Label(String(localized: "remoteControl.closeVideo"), systemImage: "xmark")
.labelStyle(.iconOnly)
}
.disabled(remoteState.videoID == nil)
}
} }
} }
@@ -358,6 +346,7 @@ struct RemoteControlView: View {
@ViewBuilder @ViewBuilder
private var nowPlayingSection: some View { private var nowPlayingSection: some View {
ZStack(alignment: .topTrailing) {
VStack(spacing: 12) { VStack(spacing: 12) {
HStack { HStack {
// Thumbnail - only show if there's an active video // Thumbnail - only show if there's an active video
@@ -447,6 +436,22 @@ struct RemoteControlView: View {
} }
} }
.padding() .padding()
.padding(.top, 8)
// Close video button
Button(role: .destructive) {
Task {
await remoteControl?.closeVideo(on: device)
dismiss()
}
} label: {
Label(String(localized: "remoteControl.closeVideo"), systemImage: "xmark")
.labelStyle(.iconOnly)
.font(.caption)
}
.disabled(remoteState.videoID == nil)
.padding(12)
}
.background(.regularMaterial, in: RoundedRectangle(cornerRadius: 12)) .background(.regularMaterial, in: RoundedRectangle(cornerRadius: 12))
} }