mirror of
https://github.com/yattee/yattee.git
synced 2024-11-12 17:18:22 +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)
|
.padding(.horizontal, 15)
|
||||||
}
|
}
|
||||||
.frame(minHeight: ChapterView.thumbnailHeight + 100)
|
|
||||||
} else {
|
} else {
|
||||||
contents
|
contents
|
||||||
}
|
}
|
||||||
|
@ -441,34 +441,48 @@ struct VideoDetails: View {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var chaptersHaveImages: Bool {
|
||||||
|
player.videoForDisplay?.chapters.allSatisfy { $0.image != nil } ?? false
|
||||||
|
}
|
||||||
|
|
||||||
var chaptersHeader: some View {
|
var chaptersHeader: some View {
|
||||||
#if canImport(UIKit)
|
Group {
|
||||||
Button(action: {
|
if !chaptersHaveImages {
|
||||||
chaptersExpanded.toggle()
|
#if canImport(UIKit)
|
||||||
}) {
|
Button(action: {
|
||||||
HStack {
|
chaptersExpanded.toggle()
|
||||||
Text("Chapters".localized())
|
}) {
|
||||||
Spacer()
|
HStack {
|
||||||
Image(systemName: chaptersExpanded ? "chevron.up" : "chevron.down")
|
Text("Chapters".localized())
|
||||||
.imageScale(.small)
|
Spacer()
|
||||||
}
|
Image(systemName: chaptersExpanded ? "chevron.up" : "chevron.down")
|
||||||
.padding(.horizontal)
|
.imageScale(.small)
|
||||||
.font(.caption)
|
}
|
||||||
.foregroundColor(.secondary)
|
.padding(.horizontal)
|
||||||
}
|
.font(.caption)
|
||||||
#elseif canImport(AppKit)
|
.foregroundColor(.secondary)
|
||||||
HStack {
|
}
|
||||||
|
#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())
|
Text("Chapters".localized())
|
||||||
Spacer()
|
.font(.caption)
|
||||||
Button(action: { chaptersExpanded.toggle() }) {
|
.foregroundColor(.secondary)
|
||||||
Image(systemName: chaptersExpanded ? "chevron.up" : "chevron.down")
|
.padding(.horizontal)
|
||||||
.imageScale(.small)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.padding(.horizontal)
|
}
|
||||||
.font(.caption)
|
|
||||||
.foregroundColor(.secondary)
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user