mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Interface tweaks for SponsorBlock during playback
Show/Hide categories in timeline. Show/Hide notice after skip. Show adjusted or actual total time.
This commit is contained in:
@@ -14,6 +14,7 @@ struct Seek: View {
|
||||
@Default(.playerControlsLayout) private var regularPlayerControlsLayout
|
||||
@Default(.fullScreenPlayerControlsLayout) private var fullScreenPlayerControlsLayout
|
||||
@Default(.sponsorBlockColors) private var sponsorBlockColors
|
||||
@Default(.sponsorBlockShowNoticeAfterSkip) private var showNoticeAfterSkip
|
||||
|
||||
private func getColor(for category: String) -> Color {
|
||||
if let hexString = sponsorBlockColors[category], let rgbValue = Int(hexString.dropFirst(), radix: 16) {
|
||||
@@ -36,6 +37,7 @@ struct Seek: View {
|
||||
#endif
|
||||
}
|
||||
.opacity(visible || YatteeApp.isForPreviews ? 1 : 0)
|
||||
.animation(.easeIn)
|
||||
}
|
||||
|
||||
var content: some View {
|
||||
@@ -130,6 +132,7 @@ struct Seek: View {
|
||||
var visible: Bool {
|
||||
guard !(model.lastSeekTime.isNil && !model.isSeeking) else { return false }
|
||||
if let type = model.lastSeekType, !type.presentable { return false }
|
||||
if !showNoticeAfterSkip { if case .segmentSkip? = model.lastSeekType { return false }}
|
||||
|
||||
return !controls.presentingControls && !controls.presentingOverlays && model.presentingOSD
|
||||
}
|
||||
|
Reference in New Issue
Block a user