From 2682e52f5aaa5f62c57b621a10b0384d929ec801 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Tue, 9 Aug 2022 19:28:16 +0200 Subject: [PATCH] Layout fixes --- Shared/Player/ChaptersView.swift | 3 +++ Shared/Player/Controls/PlayerControls.swift | 2 +- Shared/Player/Controls/TimelineView.swift | 12 ++++++------ Shared/Player/VideoPlayerView.swift | 2 ++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Shared/Player/ChaptersView.swift b/Shared/Player/ChaptersView.swift index 58534627..e0d01a0d 100644 --- a/Shared/Player/ChaptersView.swift +++ b/Shared/Player/ChaptersView.swift @@ -18,11 +18,14 @@ struct ChaptersView: View { .buttonStyle(.plain) } } + .listRowBackground(Color.clear) } #if os(macOS) .listStyle(.inset) #elseif os(iOS) .listStyle(.grouped) + .backport + .scrollContentBackground(false) #else .listStyle(.plain) #endif diff --git a/Shared/Player/Controls/PlayerControls.swift b/Shared/Player/Controls/PlayerControls.swift index 9f1d3a48..2ba1cc60 100644 --- a/Shared/Player/Controls/PlayerControls.swift +++ b/Shared/Player/Controls/PlayerControls.swift @@ -44,7 +44,7 @@ struct PlayerControls: View { buttonsBar HStack { - if !player.currentVideo.isNil, player.playingFullScreen { + if !player.currentVideo.isNil, fullScreenLayout { Button { withAnimation(Self.animation) { model.presentingDetailsOverlay = true diff --git a/Shared/Player/Controls/TimelineView.swift b/Shared/Player/Controls/TimelineView.swift index e9205c56..e9573851 100644 --- a/Shared/Player/Controls/TimelineView.swift +++ b/Shared/Player/Controls/TimelineView.swift @@ -138,22 +138,22 @@ struct TimelineView: View { .zIndex(3) } - Circle() + Rectangle() .contentShape(Rectangle()) - .foregroundColor(.clear) - .background( + .foregroundColor(Color.clear) + .overlay( ZStack { Circle() .fill(dragging ? .white : .gray) - .frame(maxWidth: 8) + .frame(width: 13) Circle() .fill(dragging ? .gray : .white) - .frame(maxWidth: 6) + .frame(width: 11) } ) .offset(x: thumbOffset) - .frame(maxWidth: thumbAreaWidth, minHeight: thumbAreaWidth) + .frame(width: thumbAreaWidth, height: thumbAreaWidth) #if !os(tvOS) .gesture( diff --git a/Shared/Player/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift index e38a9e7c..2a87d53f 100644 --- a/Shared/Player/VideoPlayerView.swift +++ b/Shared/Player/VideoPlayerView.swift @@ -411,6 +411,8 @@ struct VideoPlayerView: View { player.backend.setNeedsDrawing(false) player.exitFullScreen() } + + viewDragOffset = Self.hiddenOffset } else { withAnimation(.linear(duration: 0.2)) { viewDragOffset = 0