From 909f0353993d0792928be6bef480da9d88e652fe Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 3 Dec 2022 15:33:32 +0100 Subject: [PATCH] Minor controls changes --- Model/Player/ControlsOverlayModel.swift | 2 +- Shared/Player/Controls/PlayerControls.swift | 3 ++- Shared/Player/Controls/TimelineView.swift | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Model/Player/ControlsOverlayModel.swift b/Model/Player/ControlsOverlayModel.swift index 91f99d7a..d166b29b 100644 --- a/Model/Player/ControlsOverlayModel.swift +++ b/Model/Player/ControlsOverlayModel.swift @@ -3,7 +3,7 @@ import Foundation import SwiftUI final class ControlOverlaysModel: ObservableObject { - static let animation = Animation.easeInOut(duration: 0.2) + static let animation = Animation.easeInOut(duration: 0.1) static let shared = ControlOverlaysModel() @Published private(set) var presenting = false { didSet { handlePresentationChange() } } diff --git a/Shared/Player/Controls/PlayerControls.swift b/Shared/Player/Controls/PlayerControls.swift index ae8199aa..8c772735 100644 --- a/Shared/Player/Controls/PlayerControls.swift +++ b/Shared/Player/Controls/PlayerControls.swift @@ -453,7 +453,7 @@ struct PlayerControls: View { width _: Double? = nil, height _: Double? = nil, cornerRadius: Double = 3, - background: Bool = true, + background: Bool = false, foregroundColor: Color? = nil, active: Bool = false, action: @escaping () -> Void = {} @@ -486,6 +486,7 @@ struct PlayerControls: View { .frame(width: size ?? playerControlsLayout.buttonSize, height: size ?? playerControlsLayout.buttonSize) .modifier(ControlBackgroundModifier(enabled: useBackground)) .clipShape(RoundedRectangle(cornerRadius: cornerRadius)) + .environment(\.colorScheme, .dark) } } diff --git a/Shared/Player/Controls/TimelineView.swift b/Shared/Player/Controls/TimelineView.swift index ac379f74..c362980a 100644 --- a/Shared/Player/Controls/TimelineView.swift +++ b/Shared/Player/Controls/TimelineView.swift @@ -124,7 +124,7 @@ struct TimelineView: View { .frame(minWidth: 35) .padding(.leading, playerControlsLayout.timeLeadingEdgePadding) .padding(.trailing, playerControlsLayout.timeTrailingEdgePadding) - .modifier(ControlBackgroundModifier()) + .shadow(radius: 3) .clipShape(RoundedRectangle(cornerRadius: 4)) ZStack { @@ -171,10 +171,10 @@ struct TimelineView: View { #endif durationView + .shadow(radius: 3) .padding(.leading, playerControlsLayout.timeTrailingEdgePadding) .padding(.trailing, playerControlsLayout.timeLeadingEdgePadding) .frame(minWidth: 30, alignment: .trailing) - .modifier(ControlBackgroundModifier()) .clipShape(RoundedRectangle(cornerRadius: 4)) } #if !os(tvOS) @@ -213,6 +213,7 @@ struct TimelineView: View { #endif .font(.system(size: playerControlsLayout.timeFontSize).monospacedDigit()) .zIndex(2) + .foregroundColor(.white) } } @@ -319,7 +320,7 @@ struct TimelineView: View { ForEach(chapters) { chapter in RoundedRectangle(cornerRadius: 4) .fill(Color.orange) - .frame(maxWidth: 2, maxHeight: 12) + .frame(maxWidth: 2, maxHeight: height) .offset(x: (chapter.start * oneUnitWidth) - 1) } } @@ -376,6 +377,7 @@ struct TimelineView_Previews: PreviewProvider { return VStack(spacing: 40) { TimelineView() } + .background(Color.black) .padding() } }