Watch Next menu improvements

This commit is contained in:
Arkadiusz Fal
2022-12-19 10:48:30 +01:00
parent 2ce903b6c3
commit 636e8205fe
5 changed files with 127 additions and 31 deletions

View File

@@ -87,11 +87,9 @@ struct PlayerQueueView: View {
ForEach(player.queue) { item in
PlayerQueueRow(item: item)
.contextMenu {
removeButton(item)
removeAllButton()
if let video = item.video {
VideoContextMenuView(video: video)
.environment(\.inQueueListing, true)
}
}
}
@@ -116,22 +114,6 @@ struct PlayerQueueView: View {
.transaction { t in t.disablesAnimations = true }
}
}
private func removeButton(_ item: PlayerQueueItem) -> some View {
Button {
player.remove(item)
} label: {
Label("Remove from the queue", systemImage: "trash")
}
}
private func removeAllButton() -> some View {
Button {
player.removeQueueItems()
} label: {
Label("Clear the queue", systemImage: "trash.fill")
}
}
}
struct PlayerQueueView_Previews: PreviewProvider {