mirror of
https://github.com/yattee/yattee.git
synced 2025-01-24 13:47:03 +00:00
Playlist submenu and play buttons
This commit is contained in:
parent
f090fc9fea
commit
afe7d72352
@ -58,7 +58,7 @@ struct ChannelPlaylistView: View {
|
|||||||
.labelStyle(.iconOnly)
|
.labelStyle(.iconOnly)
|
||||||
}
|
}
|
||||||
|
|
||||||
playButton
|
playButtons
|
||||||
.labelStyle(.iconOnly)
|
.labelStyle(.iconOnly)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -105,7 +105,7 @@ struct ChannelPlaylistView: View {
|
|||||||
|
|
||||||
favoriteButton
|
favoriteButton
|
||||||
|
|
||||||
playButton
|
playButtons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -122,6 +122,8 @@ struct ChannelPlaylistView: View {
|
|||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
private var playlistMenu: some View {
|
private var playlistMenu: some View {
|
||||||
Menu {
|
Menu {
|
||||||
|
playButtons
|
||||||
|
|
||||||
favoriteButton
|
favoriteButton
|
||||||
|
|
||||||
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
|
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
|
||||||
@ -161,13 +163,13 @@ struct ChannelPlaylistView: View {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private var playButton: some View {
|
private var playButtons: some View {
|
||||||
Button {
|
Group {
|
||||||
player.play(videos)
|
Button {
|
||||||
} label: {
|
player.play(videos)
|
||||||
Label("Play All", systemImage: "play")
|
} label: {
|
||||||
}
|
Label("Play All", systemImage: "play")
|
||||||
.contextMenu {
|
}
|
||||||
Button {
|
Button {
|
||||||
player.play(videos, shuffling: true)
|
player.play(videos, shuffling: true)
|
||||||
} label: {
|
} label: {
|
||||||
|
@ -383,12 +383,7 @@ struct ChannelVideosView: View {
|
|||||||
|
|
||||||
struct ChannelVideosView_Previews: PreviewProvider {
|
struct ChannelVideosView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
ChannelVideosView(channel: Video.fixture.channel)
|
|
||||||
.environment(\.navigationStyle, .tab)
|
|
||||||
.injectFixtureEnvironmentObjects()
|
|
||||||
|
|
||||||
NavigationView {
|
NavigationView {
|
||||||
Spacer()
|
|
||||||
ChannelVideosView(channel: Video.fixture.channel)
|
ChannelVideosView(channel: Video.fixture.channel)
|
||||||
.environment(\.navigationStyle, .sidebar)
|
.environment(\.navigationStyle, .sidebar)
|
||||||
}
|
}
|
||||||
|
@ -202,10 +202,16 @@ struct PlaylistsView: View {
|
|||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
var playlistsMenu: some View {
|
var playlistsMenu: some View {
|
||||||
Menu {
|
let title = currentPlaylist?.title ?? "Playlists"
|
||||||
|
return Menu {
|
||||||
|
Menu {
|
||||||
|
selectPlaylistButton
|
||||||
|
} label: {
|
||||||
|
Label(title, systemImage: "list.and.film")
|
||||||
|
}
|
||||||
Section {
|
Section {
|
||||||
if let currentPlaylist {
|
if let currentPlaylist {
|
||||||
playButton
|
playButtons
|
||||||
|
|
||||||
editPlaylistButton
|
editPlaylistButton
|
||||||
|
|
||||||
@ -219,8 +225,6 @@ struct PlaylistsView: View {
|
|||||||
newPlaylistButton
|
newPlaylistButton
|
||||||
}
|
}
|
||||||
|
|
||||||
selectPlaylistButton
|
|
||||||
|
|
||||||
ListingStyleButtons(listingStyle: $playlistListingStyle)
|
ListingStyleButtons(listingStyle: $playlistListingStyle)
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
@ -231,7 +235,7 @@ struct PlaylistsView: View {
|
|||||||
HStack(spacing: 6) {
|
HStack(spacing: 6) {
|
||||||
Image(systemName: "list.and.film")
|
Image(systemName: "list.and.film")
|
||||||
|
|
||||||
Text(currentPlaylist?.title ?? "Playlists")
|
Text(title)
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
}
|
}
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
@ -267,7 +271,7 @@ struct PlaylistsView: View {
|
|||||||
FavoriteButton(item: FavoriteItem(section: .playlist(accounts.current.id, playlist.id)))
|
FavoriteButton(item: FavoriteItem(section: .playlist(accounts.current.id, playlist.id)))
|
||||||
.labelStyle(.iconOnly)
|
.labelStyle(.iconOnly)
|
||||||
|
|
||||||
playButton
|
playButtons
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
@ -362,13 +366,13 @@ struct PlaylistsView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var playButton: some View {
|
private var playButtons: some View {
|
||||||
Button {
|
Group {
|
||||||
player.play(items.compactMap(\.video))
|
Button {
|
||||||
} label: {
|
player.play(items.compactMap(\.video))
|
||||||
Label("Play", systemImage: "play")
|
} label: {
|
||||||
}
|
Label("Play", systemImage: "play")
|
||||||
.contextMenu {
|
}
|
||||||
Button {
|
Button {
|
||||||
player.play(items.compactMap(\.video), shuffling: true)
|
player.play(items.compactMap(\.video), shuffling: true)
|
||||||
} label: {
|
} label: {
|
||||||
|
Loading…
Reference in New Issue
Block a user