Add setting for disabling thumbnails rounding

This commit is contained in:
Arkadiusz Fal
2022-01-06 15:56:59 +01:00
parent b5d187c52f
commit 4e88f2baf8
3 changed files with 104 additions and 53 deletions

View File

@@ -18,6 +18,7 @@ struct VideoCell: View {
@Default(.channelOnThumbnail) private var channelOnThumbnail
@Default(.timeOnThumbnail) private var timeOnThumbnail
@Default(.roundedThumbnails) private var roundedThumbnails
@Default(.saveHistory) private var saveHistory
@Default(.showWatchingProgress) private var showWatchingProgress
@Default(.watchedVideoStyle) private var watchedVideoStyle
@@ -39,7 +40,7 @@ struct VideoCell: View {
}
.opacity(contentOpacity)
.buttonStyle(.plain)
.contentShape(RoundedRectangle(cornerRadius: 12))
.contentShape(RoundedRectangle(cornerRadius: thumbnailRoundingCornerRadius))
.contextMenu {
VideoContextMenuView(
video: video,
@@ -49,6 +50,14 @@ struct VideoCell: View {
}
}
private var thumbnailRoundingCornerRadius: Double {
#if os(tvOS)
return Double(12)
#else
return Double(roundedThumbnails ? 12 : 0)
#endif
}
private func playAction() {
if watchingNow {
if !player.playingInPictureInPicture {
@@ -389,7 +398,7 @@ struct VideoCell: View {
.font(.system(size: 30))
}
}
.mask(RoundedRectangle(cornerRadius: 12))
.mask(RoundedRectangle(cornerRadius: thumbnailRoundingCornerRadius))
.modifier(AspectRatioModifier())
}