mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 21:22:53 +00:00
Fix macOS related video carousel chrome
This commit is contained in:
@@ -176,6 +176,28 @@ extension ExpandedPlayerSheet {
|
||||
/// Horizontal carousel of recommended video cards.
|
||||
@ViewBuilder
|
||||
private func recommendedVideosCarousel(videos: [Video]) -> some View {
|
||||
#if os(macOS)
|
||||
ScrollView(.horizontal) {
|
||||
LazyHStack(spacing: 0) {
|
||||
ForEach(Array(videos.enumerated()), id: \.element.id) { index, video in
|
||||
Button {
|
||||
playRecommendedVideo(video)
|
||||
} label: {
|
||||
videoPreviewCard(video: video)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.frame(maxWidth: .infinity)
|
||||
.containerRelativeFrame(.horizontal)
|
||||
.id(index)
|
||||
}
|
||||
}
|
||||
.scrollTargetLayout()
|
||||
}
|
||||
.scrollPosition(id: $recommendedScrollPosition)
|
||||
.scrollTargetBehavior(.paging)
|
||||
.scrollIndicators(.hidden)
|
||||
.frame(height: 100)
|
||||
#else
|
||||
TabView(selection: Binding(
|
||||
get: { recommendedScrollPosition ?? 0 },
|
||||
set: { recommendedScrollPosition = $0 }
|
||||
@@ -190,10 +212,9 @@ extension ExpandedPlayerSheet {
|
||||
.tag(index)
|
||||
}
|
||||
}
|
||||
#if os(iOS) || os(tvOS)
|
||||
.tabViewStyle(.page(indexDisplayMode: .never))
|
||||
#endif
|
||||
.frame(height: 100)
|
||||
#endif
|
||||
}
|
||||
|
||||
/// Reusable horizontal video preview card (same style as autoplay countdown).
|
||||
|
||||
Reference in New Issue
Block a user