mirror of
https://github.com/yattee/yattee.git
synced 2026-05-14 03:15:03 +00:00
Polish Search view layout on tvOS
- Disable scroll clipping so focused source/channel/playlist cards show full halo - Remove rounded clip on source picker row that cut the Menu focus effect - Replace tappable recents header Button with a plain label on tvOS - Add vertical spacing between recent search items - Widen recent channel and playlist cards and reserve space for two-line titles - Increase horizontal spacing between cards so focus halos don't collide
This commit is contained in:
@@ -22,7 +22,13 @@ struct ChannelCardGridView: View {
|
||||
private var subscriberFont: Font { isCompact ? .caption2 : .caption }
|
||||
|
||||
/// Minimum height for channel name to reserve space for 2 lines
|
||||
private var titleMinHeight: CGFloat { isCompact ? 32 : 40 }
|
||||
private var titleMinHeight: CGFloat {
|
||||
#if os(tvOS)
|
||||
isCompact ? 56 : 80
|
||||
#else
|
||||
isCompact ? 32 : 40
|
||||
#endif
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .center, spacing: isCompact ? 8 : 12) {
|
||||
@@ -46,7 +52,9 @@ struct ChannelCardGridView: View {
|
||||
.fontWeight(.medium)
|
||||
.lineLimit(2)
|
||||
.multilineTextAlignment(.center)
|
||||
.frame(minHeight: titleMinHeight, alignment: .top)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: titleMinHeight, alignment: .top)
|
||||
|
||||
// Subscriber count row - reserve space even when nil
|
||||
HStack(spacing: 4) {
|
||||
|
||||
@@ -17,6 +17,14 @@ struct PlaylistCardView: View {
|
||||
|
||||
private var titleFont: Font { isCompact ? .caption : .subheadline }
|
||||
private var authorFont: Font { isCompact ? .caption2 : .caption }
|
||||
|
||||
private var metadataHeight: CGFloat {
|
||||
#if os(tvOS)
|
||||
isCompact ? 90 : 110
|
||||
#else
|
||||
isCompact ? 50 : 58
|
||||
#endif
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: isCompact ? 4 : 8) {
|
||||
@@ -61,15 +69,17 @@ struct PlaylistCardView: View {
|
||||
.fontWeight(.medium)
|
||||
.lineLimit(2)
|
||||
.multilineTextAlignment(.leading)
|
||||
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
Text(playlist.authorName)
|
||||
.font(authorFont)
|
||||
.foregroundStyle(.secondary)
|
||||
.lineLimit(1)
|
||||
|
||||
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
.frame(height: isCompact ? 50 : 58)
|
||||
.frame(height: metadataHeight)
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user