Add setting for toggle video watch status

This commit is contained in:
Arkadiusz Fal
2023-04-22 18:04:28 +02:00
parent f852782f5e
commit 2fe211edb4
3 changed files with 20 additions and 8 deletions

View File

@@ -8,21 +8,28 @@ struct WatchView: View {
var duration: Double
@Default(.watchedVideoBadgeColor) private var watchedVideoBadgeColor
@Default(.showToggleWatchedStatusButton) private var showToggleWatchedStatusButton
var backgroundContext = PersistenceController.shared.container.newBackgroundContext()
var body: some View {
#if os(tvOS)
if showToggleWatchedStatusButton {
#if os(tvOS)
if finished {
image
}
#else
Button(action: toggleWatch) {
image
}
.opacity(finished ? 1 : 0.4)
.buttonStyle(.plain)
#endif
} else {
if finished {
image
}
#else
Button(action: toggleWatch) {
image
}
.opacity(finished ? 1 : 0.4)
.buttonStyle(.plain)
#endif
}
}
var image: some View {