mirror of
https://github.com/yattee/yattee.git
synced 2025-08-04 01:34:10 +00:00
Add button for toggling watch status
This commit is contained in:
@@ -161,7 +161,7 @@ struct VideoBanner: View {
|
||||
|
||||
@ViewBuilder private var smallThumbnail: some View {
|
||||
ZStack(alignment: .bottomTrailing) {
|
||||
ZStack(alignment: .bottomLeading) {
|
||||
ZStack(alignment: .topLeading) {
|
||||
ZStack {
|
||||
Color("PlaceholderColor")
|
||||
|
||||
@@ -178,17 +178,10 @@ struct VideoBanner: View {
|
||||
|
||||
if saveHistory,
|
||||
watchedVideoStyle.isShowingBadge,
|
||||
watch?.finished ?? false
|
||||
let video
|
||||
{
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(Color(
|
||||
watchedVideoBadgeColor == .colorSchemeBased ? "WatchProgressBarColor" :
|
||||
watchedVideoBadgeColor == .red ? "AppRedColor" : "AppBlueColor"
|
||||
))
|
||||
.background(Color.white)
|
||||
.clipShape(Circle())
|
||||
.imageScale(.medium)
|
||||
.offset(x: 5, y: -5)
|
||||
WatchView(watch: watch, videoID: video.videoID, duration: video.length)
|
||||
.offset(x: 2, y: 2)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -363,28 +363,39 @@ struct VideoCell: View {
|
||||
(!timeOnThumbnail && !videoDuration.isNil)
|
||||
}
|
||||
|
||||
private var showProgressView: Bool {
|
||||
saveHistory && showWatchingProgress && ((watch?.finished ?? false) || watch?.progress ?? 0 > 0)
|
||||
}
|
||||
|
||||
private var thumbnail: some View {
|
||||
ZStack(alignment: .leading) {
|
||||
ZStack(alignment: .bottomLeading) {
|
||||
thumbnailImage
|
||||
if saveHistory, showWatchingProgress, watch?.progress ?? 0 > 0 {
|
||||
ProgressView(value: watch!.progress, total: 100)
|
||||
.progressViewStyle(LinearProgressViewStyle(tint: Color("AppRedColor")))
|
||||
#if os(tvOS)
|
||||
.padding(.horizontal, 16)
|
||||
#else
|
||||
.padding(.horizontal, 10)
|
||||
#endif
|
||||
#if os(macOS)
|
||||
.offset(x: 0, y: 4)
|
||||
#else
|
||||
.offset(x: 0, y: -3)
|
||||
#endif
|
||||
}
|
||||
|
||||
ProgressView(value: watch?.progress ?? 0, total: 100)
|
||||
.progressViewStyle(LinearProgressViewStyle(tint: Color("AppRedColor")))
|
||||
#if os(tvOS)
|
||||
.padding(.horizontal, 16)
|
||||
#else
|
||||
.padding(.horizontal, 10)
|
||||
#endif
|
||||
#if os(macOS)
|
||||
.offset(x: 0, y: 4)
|
||||
#else
|
||||
.offset(x: 0, y: -3)
|
||||
#endif
|
||||
.opacity(showProgressView ? 1 : 0)
|
||||
}
|
||||
|
||||
VStack {
|
||||
HStack(alignment: .top) {
|
||||
if saveHistory,
|
||||
watchedVideoStyle.isShowingBadge,
|
||||
let video
|
||||
{
|
||||
WatchView(watch: watch, videoID: video.videoID, duration: video.length)
|
||||
}
|
||||
|
||||
if video.live {
|
||||
DetailBadge(text: "Live", style: .outstanding)
|
||||
} else if video.upcoming {
|
||||
@@ -408,23 +419,6 @@ struct VideoCell: View {
|
||||
Spacer()
|
||||
|
||||
HStack {
|
||||
if saveHistory,
|
||||
watchedVideoStyle.isShowingBadge,
|
||||
watch?.finished ?? false
|
||||
{
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(Color(
|
||||
watchedVideoBadgeColor == .colorSchemeBased ? "WatchProgressBarColor" :
|
||||
watchedVideoBadgeColor == .red ? "AppRedColor" : "AppBlueColor"
|
||||
))
|
||||
.background(Color.white)
|
||||
.clipShape(Circle())
|
||||
#if os(tvOS)
|
||||
.font(.system(size: 40))
|
||||
#else
|
||||
.font(.system(size: 30))
|
||||
#endif
|
||||
}
|
||||
Spacer()
|
||||
|
||||
if timeOnThumbnail,
|
||||
|
@@ -159,7 +159,6 @@ struct VideoContextMenuView: View {
|
||||
Button {
|
||||
guard let watch else { return }
|
||||
player.removeWatch(watch)
|
||||
FeedModel.shared.calculateUnwatchedFeed()
|
||||
} label: {
|
||||
Label("Remove from history", systemImage: "delete.left.fill")
|
||||
}
|
||||
|
Reference in New Issue
Block a user