mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Add options for history: badge color and reset watched status on playing
This commit is contained in:
@@ -13,7 +13,9 @@ struct HistorySettings: View {
|
||||
@Default(.showWatchingProgress) private var showWatchingProgress
|
||||
@Default(.watchedThreshold) private var watchedThreshold
|
||||
@Default(.watchedVideoStyle) private var watchedVideoStyle
|
||||
@Default(.watchedVideoBadgeColor) private var watchedVideoBadgeColor
|
||||
@Default(.watchedVideoPlayNowBehavior) private var watchedVideoPlayNowBehavior
|
||||
@Default(.resetWatchedStatusOnPlaying) private var resetWatchedStatusOnPlaying
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
@@ -26,14 +28,18 @@ struct HistorySettings: View {
|
||||
#if !os(tvOS)
|
||||
watchedThresholdPicker
|
||||
watchedVideoStylePicker
|
||||
watchedVideoBadgeColorPicker
|
||||
watchedVideoPlayNowBehaviorPicker
|
||||
resetWatchedStatusOnPlayingToggle
|
||||
#endif
|
||||
}
|
||||
|
||||
#if os(tvOS)
|
||||
watchedThresholdPicker
|
||||
watchedVideoStylePicker
|
||||
watchedVideoBadgeColorPicker
|
||||
watchedVideoPlayNowBehaviorPicker
|
||||
resetWatchedStatusOnPlayingToggle
|
||||
#endif
|
||||
|
||||
#if os(macOS)
|
||||
@@ -68,6 +74,7 @@ struct HistorySettings: View {
|
||||
Text("Nothing").tag(WatchedVideoStyle.nothing)
|
||||
Text("Badge").tag(WatchedVideoStyle.badge)
|
||||
Text("Decreased opacity").tag(WatchedVideoStyle.decreasedOpacity)
|
||||
Text("Badge & Decreased opacity").tag(WatchedVideoStyle.both)
|
||||
}
|
||||
.disabled(!saveHistory)
|
||||
.labelsHidden()
|
||||
@@ -80,6 +87,25 @@ struct HistorySettings: View {
|
||||
}
|
||||
}
|
||||
|
||||
private var watchedVideoBadgeColorPicker: some View {
|
||||
Section(header: header("Badge color")) {
|
||||
Picker("Badge color", selection: $watchedVideoBadgeColor) {
|
||||
Text("Based on system color scheme").tag(WatchedVideoBadgeColor.colorSchemeBased)
|
||||
Text("Blue").tag(WatchedVideoBadgeColor.blue)
|
||||
Text("Red").tag(WatchedVideoBadgeColor.red)
|
||||
}
|
||||
.disabled(!saveHistory)
|
||||
.disabled(watchedVideoStyle == .decreasedOpacity)
|
||||
.labelsHidden()
|
||||
|
||||
#if os(iOS)
|
||||
.pickerStyle(.automatic)
|
||||
#elseif os(tvOS)
|
||||
.pickerStyle(.inline)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private var watchedVideoPlayNowBehaviorPicker: some View {
|
||||
Section(header: header("When partially watched video is played")) {
|
||||
Picker("When partially watched video is played", selection: $watchedVideoPlayNowBehavior) {
|
||||
@@ -97,6 +123,10 @@ struct HistorySettings: View {
|
||||
}
|
||||
}
|
||||
|
||||
private var resetWatchedStatusOnPlayingToggle: some View {
|
||||
Toggle("Reset watched status when playing again", isOn: $resetWatchedStatusOnPlaying)
|
||||
}
|
||||
|
||||
private var clearHistoryButton: some View {
|
||||
Button("Clear History") {
|
||||
presentingClearHistoryConfirmation = true
|
||||
|
@@ -75,7 +75,7 @@ struct SettingsView: View {
|
||||
.tag(Tabs.updates)
|
||||
}
|
||||
.padding(20)
|
||||
.frame(width: 400, height: 380)
|
||||
.frame(width: 400, height: 400)
|
||||
#else
|
||||
NavigationView {
|
||||
List {
|
||||
|
Reference in New Issue
Block a user