Fix playlists view on iOS

This commit is contained in:
Arkadiusz Fal 2023-05-22 15:33:13 +02:00
parent 8f48da93d8
commit 16fb7087e3

View File

@ -364,28 +364,32 @@ struct PlaylistsView: View {
var header: some View { var header: some View {
HStack { HStack {
if model.isEmpty { #if os(tvOS)
Text("No Playlists") if model.isEmpty {
.foregroundColor(.secondary) Text("No Playlists")
} else { .foregroundColor(.secondary)
selectPlaylistButton } else {
} selectPlaylistButton
}
if let playlist = currentPlaylist { if let playlist = currentPlaylist {
editPlaylistButton editPlaylistButton
FavoriteButton(item: FavoriteItem(section: .playlist(accounts.current.id, playlist.id))) FavoriteButton(item: FavoriteItem(section: .playlist(accounts.current.id, playlist.id)))
.labelStyle(.iconOnly) .labelStyle(.iconOnly)
playButtons playButtons
} }
newPlaylistButton newPlaylistButton
Spacer() Spacer()
ListingStyleButtons(listingStyle: $playlistListingStyle) ListingStyleButtons(listingStyle: $playlistListingStyle)
HideShortsButtons(hide: $hideShorts) HideShortsButtons(hide: $hideShorts)
#else
Spacer()
#endif
if let account = accounts.current, showCacheStatus { if let account = accounts.current, showCacheStatus {
CacheStatusHeader( CacheStatusHeader(
@ -394,19 +398,21 @@ struct PlaylistsView: View {
) )
} }
Button { #if os(tvOS)
model.load(force: true) Button {
loadResource() model.load(force: true)
} label: { loadResource()
Label("Refresh", systemImage: "arrow.clockwise") } label: {
.labelStyle(.iconOnly) Label("Refresh", systemImage: "arrow.clockwise")
} .labelStyle(.iconOnly)
}
#endif
} }
.labelStyle(.iconOnly) .labelStyle(.iconOnly)
.font(.caption) .font(.caption)
.imageScale(.small) .imageScale(.small)
.padding(.leading, 30)
#if os(tvOS) #if os(tvOS)
.padding(.leading, 30)
.padding(.bottom, 15) .padding(.bottom, 15)
.padding(.trailing, 30) .padding(.trailing, 30)
#endif #endif