mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 10:55:03 +00:00
Hide description header in tvOS video info right column
The right column is already dedicated to video info so the "Description" label is redundant. Add an opt-out `showsHeader` parameter to `TVScrollableDescription` (default true) and pass false from `VideoInfoView`; the player overlay and channel view keep the header.
This commit is contained in:
@@ -309,6 +309,7 @@ enum TVDetailsFocusItem: Hashable {
|
|||||||
struct TVScrollableDescription: View {
|
struct TVScrollableDescription: View {
|
||||||
let description: String
|
let description: String
|
||||||
@Binding var isScrollLocked: Bool
|
@Binding var isScrollLocked: Bool
|
||||||
|
var showsHeader: Bool = true
|
||||||
|
|
||||||
@FocusState private var isFocused: Bool
|
@FocusState private var isFocused: Bool
|
||||||
@State private var scrollOffset: CGFloat = 0
|
@State private var scrollOffset: CGFloat = 0
|
||||||
@@ -358,6 +359,7 @@ struct TVScrollableDescription: View {
|
|||||||
|
|
||||||
private var descriptionContent: some View {
|
private var descriptionContent: some View {
|
||||||
VStack(alignment: .leading, spacing: 12) {
|
VStack(alignment: .leading, spacing: 12) {
|
||||||
|
if showsHeader {
|
||||||
HStack {
|
HStack {
|
||||||
Text("player.description")
|
Text("player.description")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
@@ -371,6 +373,7 @@ struct TVScrollableDescription: View {
|
|||||||
.foregroundStyle(.white.opacity(0.5))
|
.foregroundStyle(.white.opacity(0.5))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Clipped container for scrollable text. The Rectangle owns the
|
// Clipped container for scrollable text. The Rectangle owns the
|
||||||
// layout size (fills available space) so the Text's intrinsic
|
// layout size (fills available space) so the Text's intrinsic
|
||||||
|
|||||||
@@ -675,7 +675,8 @@ struct VideoInfoView: View {
|
|||||||
} else if let description = displayedVideo?.description, !description.isEmpty {
|
} else if let description = displayedVideo?.description, !description.isEmpty {
|
||||||
TVScrollableDescription(
|
TVScrollableDescription(
|
||||||
description: description,
|
description: description,
|
||||||
isScrollLocked: $isDescriptionScrollLocked
|
isScrollLocked: $isDescriptionScrollLocked,
|
||||||
|
showsHeader: false
|
||||||
)
|
)
|
||||||
.frame(height: isDescriptionScrollLocked ? geometry.size.height : 450)
|
.frame(height: isDescriptionScrollLocked ? geometry.size.height : 450)
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
|
|||||||
Reference in New Issue
Block a user