mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
vertical chapters are full width and max 3 lines
This commit is contained in:
parent
3feafc153c
commit
fb5cd0f681
@ -49,14 +49,14 @@ struct ChapterView: View {
|
|||||||
}
|
}
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
Text(chapter.title)
|
Text(chapter.title)
|
||||||
.lineLimit(2)
|
.lineLimit(3)
|
||||||
.multilineTextAlignment(.leading)
|
.multilineTextAlignment(.leading)
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
Text(chapter.start.formattedAsPlaybackTime(allowZero: true) ?? "")
|
Text(chapter.start.formattedAsPlaybackTime(allowZero: true) ?? "")
|
||||||
.font(.system(.subheadline).monospacedDigit())
|
.font(.system(.subheadline).monospacedDigit())
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
}
|
}
|
||||||
.frame(maxWidth: Self.thumbnailWidth, alignment: .leading)
|
.frame(maxWidth: !chapter.image.isNil ? Self.thumbnailWidth : nil, alignment: .leading)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -16,7 +16,7 @@ struct ChaptersView: View {
|
|||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
if !chapters.isEmpty {
|
if !chapters.isEmpty {
|
||||||
if expand || chaptersHaveImages {
|
if chaptersHaveImages {
|
||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
List {
|
List {
|
||||||
Section {
|
Section {
|
||||||
@ -28,19 +28,22 @@ struct ChaptersView: View {
|
|||||||
}
|
}
|
||||||
.listStyle(.plain)
|
.listStyle(.plain)
|
||||||
#else
|
#else
|
||||||
if chaptersHaveImages {
|
ScrollView(.horizontal) {
|
||||||
ScrollView(.horizontal) {
|
LazyHStack(spacing: 20) {
|
||||||
LazyHStack(spacing: 20) {
|
ForEach(chapters) { chapter in
|
||||||
ForEach(chapters) { chapter in
|
ChapterView(chapter: chapter)
|
||||||
ChapterView(chapter: chapter)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 15)
|
|
||||||
}
|
}
|
||||||
} else {
|
.padding(.horizontal, 15)
|
||||||
contents
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
} else if expand {
|
||||||
|
Section {
|
||||||
|
ForEach(chapters) { chapter in
|
||||||
|
ChapterView(chapter: chapter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.padding(.horizontal)
|
||||||
} else {
|
} else {
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
Button(action: {
|
Button(action: {
|
||||||
|
Loading…
Reference in New Issue
Block a user