mirror of
https://github.com/yattee/yattee.git
synced 2025-05-19 13:01:09 +00:00
vertical chapters with images are always collapsed
This commit is contained in:
parent
a7baaeb485
commit
8f08674527
@ -15,47 +15,44 @@ struct ChaptersView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
if expand && !chapters.isEmpty {
|
if !chapters.isEmpty {
|
||||||
#if os(tvOS)
|
if expand || chaptersHaveImages {
|
||||||
List {
|
#if os(tvOS)
|
||||||
Section {
|
List {
|
||||||
ForEach(chapters) { chapter in
|
Section {
|
||||||
ChapterView(chapter: chapter)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.listRowBackground(Color.clear)
|
|
||||||
}
|
|
||||||
.listStyle(.plain)
|
|
||||||
#else
|
|
||||||
if chaptersHaveImages {
|
|
||||||
ScrollView(.horizontal) {
|
|
||||||
LazyHStack(spacing: 20) {
|
|
||||||
ForEach(chapters) { chapter in
|
ForEach(chapters) { chapter in
|
||||||
ChapterView(chapter: chapter)
|
ChapterView(chapter: chapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 15)
|
.listRowBackground(Color.clear)
|
||||||
}
|
}
|
||||||
.frame(minHeight: ChapterView.thumbnailHeight + 100)
|
.listStyle(.plain)
|
||||||
} else {
|
#else
|
||||||
Section {
|
if chaptersHaveImages {
|
||||||
ForEach(chapters) { chapter in
|
ScrollView(.horizontal) {
|
||||||
ChapterView(chapter: chapter)
|
LazyHStack(spacing: 20) {
|
||||||
|
ForEach(chapters) { chapter in
|
||||||
|
ChapterView(chapter: chapter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.padding(.horizontal, 15)
|
||||||
}
|
}
|
||||||
|
.frame(minHeight: ChapterView.thumbnailHeight + 100)
|
||||||
|
} else {
|
||||||
|
contents
|
||||||
}
|
}
|
||||||
.padding(.horizontal)
|
#endif
|
||||||
}
|
} else {
|
||||||
#endif
|
#if os(iOS)
|
||||||
} else if !chapters.isEmpty {
|
Button(action: {
|
||||||
#if os(iOS)
|
self.expand.toggle()
|
||||||
Button(action: {
|
}) {
|
||||||
self.expand.toggle() // Use your expanding logic here
|
contents
|
||||||
}) {
|
}
|
||||||
|
#else
|
||||||
contents
|
contents
|
||||||
}
|
#endif
|
||||||
#else
|
}
|
||||||
contents
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user