mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Video banner layout fixes
This commit is contained in:
parent
57b2276f36
commit
d38a507be5
@ -95,11 +95,36 @@ struct VideoBanner: View {
|
||||
.lineLimit(1)
|
||||
|
||||
#if os(tvOS)
|
||||
progressView
|
||||
extraAttributes
|
||||
#endif
|
||||
}
|
||||
.foregroundColor(.secondary)
|
||||
|
||||
#if !os(tvOS)
|
||||
extraAttributes
|
||||
#endif
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.frame(maxHeight: .infinity)
|
||||
#if os(tvOS)
|
||||
.padding(.vertical)
|
||||
#endif
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.contentShape(Rectangle())
|
||||
#if os(tvOS)
|
||||
.buttonStyle(.card)
|
||||
#else
|
||||
.buttonStyle(.plain)
|
||||
#endif
|
||||
#if os(tvOS)
|
||||
.padding(.trailing, 10)
|
||||
#endif
|
||||
.opacity(contentOpacity)
|
||||
.id(id ?? video?.videoID ?? video?.id)
|
||||
}
|
||||
|
||||
private var extraAttributes: some View {
|
||||
HStack(spacing: 16) {
|
||||
if let video {
|
||||
if let date = video.publishedDate {
|
||||
@ -120,6 +145,10 @@ struct VideoBanner: View {
|
||||
if timeInfo {
|
||||
Spacer()
|
||||
|
||||
#if os(tvOS)
|
||||
progressView
|
||||
#endif
|
||||
|
||||
timeLabel
|
||||
.layoutPriority(1)
|
||||
}
|
||||
@ -128,25 +157,6 @@ struct VideoBanner: View {
|
||||
.lineLimit(1)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.frame(maxHeight: .infinity)
|
||||
#if os(tvOS)
|
||||
.padding(.vertical)
|
||||
#endif
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.contentShape(Rectangle())
|
||||
#if os(tvOS)
|
||||
.buttonStyle(.card)
|
||||
#else
|
||||
.buttonStyle(.plain)
|
||||
#endif
|
||||
#if os(tvOS)
|
||||
.padding(.trailing, 10)
|
||||
#endif
|
||||
.opacity(contentOpacity)
|
||||
.id(id ?? video?.videoID ?? video?.id)
|
||||
}
|
||||
|
||||
@ViewBuilder private var smallThumbnail: some View {
|
||||
ZStack(alignment: .bottomLeading) {
|
||||
|
Loading…
Reference in New Issue
Block a user