remove toggle for vertical chapters

This commit is contained in:
Toni Förster 2023-11-27 13:34:18 +01:00
parent 8f08674527
commit 3feafc153c
No known key found for this signature in database
GPG Key ID: 292F3E5086C83FC7
2 changed files with 39 additions and 26 deletions

View File

@ -37,7 +37,6 @@ struct ChaptersView: View {
} }
.padding(.horizontal, 15) .padding(.horizontal, 15)
} }
.frame(minHeight: ChapterView.thumbnailHeight + 100)
} else { } else {
contents contents
} }

View File

@ -441,7 +441,13 @@ struct VideoDetails: View {
#endif #endif
} }
var chaptersHaveImages: Bool {
player.videoForDisplay?.chapters.allSatisfy { $0.image != nil } ?? false
}
var chaptersHeader: some View { var chaptersHeader: some View {
Group {
if !chaptersHaveImages {
#if canImport(UIKit) #if canImport(UIKit)
Button(action: { Button(action: {
chaptersExpanded.toggle() chaptersExpanded.toggle()
@ -469,6 +475,14 @@ struct VideoDetails: View {
.font(.caption) .font(.caption)
.foregroundColor(.secondary) .foregroundColor(.secondary)
#endif #endif
} else {
// No button, just the title when there are images
Text("Chapters".localized())
.font(.caption)
.foregroundColor(.secondary)
.padding(.horizontal)
}
}
} }
} }