From 06bae05a667383eacbe950f71c3040656233ecf9 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 5 Nov 2021 19:23:28 +0100 Subject: [PATCH] Minor UI fixes --- Shared/Player/VideoDetails.swift | 7 +++++-- Shared/Videos/VerticalCells.swift | 4 ++-- Shared/Videos/VideoCell.swift | 2 +- tvOS/NowPlayingView.swift | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Shared/Player/VideoDetails.swift b/Shared/Player/VideoDetails.swift index 586ced01..cf0506e5 100644 --- a/Shared/Player/VideoDetails.swift +++ b/Shared/Player/VideoDetails.swift @@ -58,6 +58,11 @@ struct VideoDetails: View { } subscriptionsSection + .onChange(of: video) { video in + if let video = video { + subscribed = subscriptions.isSubscribing(video.channel.id) + } + } } .padding(.horizontal) @@ -108,8 +113,6 @@ struct VideoDetails: View { subscribed = false return } - - subscribed = subscriptions.isSubscribing(video!.channel.id) } .onChange(of: sidebarQueue) { queue in if queue { diff --git a/Shared/Videos/VerticalCells.swift b/Shared/Videos/VerticalCells.swift index 58d87691..dbcebd2b 100644 --- a/Shared/Videos/VerticalCells.swift +++ b/Shared/Videos/VerticalCells.swift @@ -26,7 +26,7 @@ struct VerticalCells: View { var columns: [GridItem] { #if os(tvOS) - items.count < 3 ? Array(repeating: GridItem(.fixed(540)), count: [items.count, 1].max()!) : adaptiveItem + items.count < 3 ? Array(repeating: GridItem(.fixed(500)), count: [items.count, 1].max()!) : adaptiveItem #else adaptiveItem #endif @@ -40,7 +40,7 @@ struct VerticalCells: View { #if os(iOS) return verticalSizeClass == .regular ? 320 : 800 #elseif os(tvOS) - return 540 + return 500 #else return 320 #endif diff --git a/Shared/Videos/VideoCell.swift b/Shared/Videos/VideoCell.swift index 43127b83..60b39011 100644 --- a/Shared/Videos/VideoCell.swift +++ b/Shared/Videos/VideoCell.swift @@ -152,7 +152,7 @@ struct VideoCell: View { VStack(alignment: .leading, spacing: 0) { Group { VStack(alignment: .leading, spacing: 0) { - videoDetail(video.title, lineLimit: channelOnThumbnail ? 3 : 2) + videoDetail(video.title, lineLimit: 2) #if os(tvOS) .frame(minHeight: 60, alignment: .top) #elseif os(macOS) diff --git a/tvOS/NowPlayingView.swift b/tvOS/NowPlayingView.swift index 289897e2..42fdbd03 100644 --- a/tvOS/NowPlayingView.swift +++ b/tvOS/NowPlayingView.swift @@ -90,11 +90,11 @@ struct NowPlayingView: View { VideoBanner(video: item.video, playbackTime: item.playbackTime, videoDuration: item.videoDuration) } .contextMenu { - Button("Delete", role: .destructive) { + Button("Remove", role: .destructive) { player.removeHistory(item) } - Button("Delete History", role: .destructive) { + Button("Remove All", role: .destructive) { player.removeHistoryItems() } }