From f631d4f6e3d461ec8edab873571985e6167a7a9e Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Wed, 8 Jun 2022 00:05:02 +0200 Subject: [PATCH] Minor layout fixes --- Model/Player/PlayerControlsModel.swift | 2 +- Shared/Player/Controls/PlayerControls.swift | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Model/Player/PlayerControlsModel.swift b/Model/Player/PlayerControlsModel.swift index 27147ff4..cd4dde07 100644 --- a/Model/Player/PlayerControlsModel.swift +++ b/Model/Player/PlayerControlsModel.swift @@ -106,7 +106,7 @@ final class PlayerControlsModel: ObservableObject { removeTimer() - guard !player.musicMode else { + guard let player = player, !player.musicMode else { return } diff --git a/Shared/Player/Controls/PlayerControls.swift b/Shared/Player/Controls/PlayerControls.swift index 5c6511a6..8bcaa318 100644 --- a/Shared/Player/Controls/PlayerControls.swift +++ b/Shared/Player/Controls/PlayerControls.swift @@ -34,6 +34,7 @@ struct PlayerControls: View { Group { HStack { statusBar + .lineLimit(1) .padding(3) #if os(macOS) .background(VisualEffectBlur(material: .hudWindow)) @@ -415,20 +416,12 @@ struct PlayerControls_Previews: PreviewProvider { model.currentTime = .secondsInDefaultTimescale(0) model.duration = .secondsInDefaultTimescale(120) - let view = ZStack { + return ZStack { Color.gray PlayerControls(player: PlayerModel(), thumbnails: ThumbnailsModel()) .injectFixtureEnvironmentObjects() .environmentObject(model) } - - return Group { - if #available(iOS 15.0, macOS 12.0, tvOS 15.0, *) { - view.previewInterfaceOrientation(.landscapeLeft) - } else { - view - } - } } }