mirror of
https://github.com/yattee/yattee.git
synced 2024-11-09 15:58:20 +00:00
remove toggle for vertical chapters
This commit is contained in:
parent
8f08674527
commit
3feafc153c
@ -37,7 +37,6 @@ struct ChaptersView: View {
|
||||
}
|
||||
.padding(.horizontal, 15)
|
||||
}
|
||||
.frame(minHeight: ChapterView.thumbnailHeight + 100)
|
||||
} else {
|
||||
contents
|
||||
}
|
||||
|
@ -441,34 +441,48 @@ struct VideoDetails: View {
|
||||
#endif
|
||||
}
|
||||
|
||||
var chaptersHaveImages: Bool {
|
||||
player.videoForDisplay?.chapters.allSatisfy { $0.image != nil } ?? false
|
||||
}
|
||||
|
||||
var chaptersHeader: some View {
|
||||
#if canImport(UIKit)
|
||||
Button(action: {
|
||||
chaptersExpanded.toggle()
|
||||
}) {
|
||||
HStack {
|
||||
Text("Chapters".localized())
|
||||
Spacer()
|
||||
Image(systemName: chaptersExpanded ? "chevron.up" : "chevron.down")
|
||||
.imageScale(.small)
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
#elseif canImport(AppKit)
|
||||
HStack {
|
||||
Group {
|
||||
if !chaptersHaveImages {
|
||||
#if canImport(UIKit)
|
||||
Button(action: {
|
||||
chaptersExpanded.toggle()
|
||||
}) {
|
||||
HStack {
|
||||
Text("Chapters".localized())
|
||||
Spacer()
|
||||
Image(systemName: chaptersExpanded ? "chevron.up" : "chevron.down")
|
||||
.imageScale(.small)
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
#elseif canImport(AppKit)
|
||||
HStack {
|
||||
Text("Chapters".localized())
|
||||
Spacer()
|
||||
Button(action: { chaptersExpanded.toggle() }) {
|
||||
Image(systemName: chaptersExpanded ? "chevron.up" : "chevron.down")
|
||||
.imageScale(.small)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
#endif
|
||||
} else {
|
||||
// No button, just the title when there are images
|
||||
Text("Chapters".localized())
|
||||
Spacer()
|
||||
Button(action: { chaptersExpanded.toggle() }) {
|
||||
Image(systemName: chaptersExpanded ? "chevron.up" : "chevron.down")
|
||||
.imageScale(.small)
|
||||
}
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
.padding(.horizontal)
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user