mirror of
https://github.com/yattee/yattee.git
synced 2024-11-12 17:18:22 +00:00
new SeekType chapterSkip
When a user taps on a chapter, the pop now also shows the name of the chapter. The chapters are now marked in AppRedColor instead of orange. This is based on PR #639 That one needs to be merged first before this one can go in.
This commit is contained in:
parent
ae65acdd16
commit
03fbb4933a
@ -1,6 +1,7 @@
|
||||
import Foundation
|
||||
|
||||
enum SeekType: Equatable {
|
||||
case chapterSkip(String)
|
||||
case segmentSkip(String)
|
||||
case segmentRestore
|
||||
case userInteracted
|
||||
|
@ -85,6 +85,14 @@ struct Seek: View {
|
||||
.font(.system(size: playerControlsLayout.segmentFontSize))
|
||||
.foregroundColor(getColor(for: category))
|
||||
.padding(.bottom, 3)
|
||||
case let .chapterSkip(chapter):
|
||||
Divider()
|
||||
Text(chapter)
|
||||
.font(.system(size: playerControlsLayout.segmentFontSize))
|
||||
.truncationMode(.tail)
|
||||
.multilineTextAlignment(.center)
|
||||
.foregroundColor(Color("AppRedColor"))
|
||||
.padding(.bottom, 3)
|
||||
default:
|
||||
EmptyView()
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ struct TimelineView: View {
|
||||
var chaptersLayers: some View {
|
||||
ForEach(chapters) { chapter in
|
||||
RoundedRectangle(cornerRadius: 4)
|
||||
.fill(Color.orange)
|
||||
.fill(Color("AppRedColor"))
|
||||
.frame(maxWidth: 2, maxHeight: height)
|
||||
.offset(x: (chapter.start * oneUnitWidth) - 1)
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import SwiftUI
|
||||
|
||||
var body: some View {
|
||||
Button(action: {
|
||||
player.backend.seek(to: chapter.start, seekType: .userInteracted)
|
||||
player.backend.seek(to: chapter.start, seekType: .chapterSkip(chapter.title))
|
||||
}) {
|
||||
Group {
|
||||
verticalChapter
|
||||
@ -72,7 +72,7 @@ import SwiftUI
|
||||
|
||||
var body: some View {
|
||||
Button {
|
||||
player.backend.seek(to: chapter.start, seekType: .userInteracted)
|
||||
player.backend.seek(to: chapter.start, seekType: .chapterSkip(chapter.title))
|
||||
} label: {
|
||||
Group {
|
||||
horizontalChapter
|
||||
|
Loading…
Reference in New Issue
Block a user