diff --git a/Shared/Defaults.swift b/Shared/Defaults.swift index 43c44665..58de5996 100644 --- a/Shared/Defaults.swift +++ b/Shared/Defaults.swift @@ -52,6 +52,7 @@ extension Defaults.Keys { static let lockPortraitWhenBrowsing = Key("lockPortraitWhenBrowsing", default: UIDevice.current.userInterfaceIdiom == .phone) #endif static let showUnwatchedFeedBadges = Key("showUnwatchedFeedBadges", default: false) + static let showToggleWatchedStatusButton = Key("showToggleWatchedStatusButton", default: false) static let expandChannelDescription = Key("expandChannelDescription", default: false) static let channelOnThumbnail = Key("channelOnThumbnail", default: false) static let timeOnThumbnail = Key("timeOnThumbnail", default: true) diff --git a/Shared/Settings/BrowsingSettings.swift b/Shared/Settings/BrowsingSettings.swift index 70d32b1a..6f364ade 100644 --- a/Shared/Settings/BrowsingSettings.swift +++ b/Shared/Settings/BrowsingSettings.swift @@ -16,6 +16,7 @@ struct BrowsingSettings: View { @Default(.thumbnailsQuality) private var thumbnailsQuality @Default(.channelOnThumbnail) private var channelOnThumbnail @Default(.timeOnThumbnail) private var timeOnThumbnail + @Default(.showToggleWatchedStatusButton) private var showToggleWatchedStatusButton @Default(.showHome) private var showHome @Default(.showFavoritesInHome) private var showFavoritesInHome @Default(.showQueueInHome) private var showQueueInHome @@ -244,6 +245,9 @@ struct BrowsingSettings: View { #endif Toggle("Show channel name", isOn: $channelOnThumbnail) Toggle("Show video length", isOn: $timeOnThumbnail) + #if !os(tvOS) + Toggle("Show toggle watch status button", isOn: $showToggleWatchedStatusButton) + #endif } } diff --git a/Shared/Videos/WatchView.swift b/Shared/Videos/WatchView.swift index 18ffe690..a1261562 100644 --- a/Shared/Videos/WatchView.swift +++ b/Shared/Videos/WatchView.swift @@ -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 {