From 42f0ff80f892df3d3924ed77f0cb2e4528cf3211 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 25 Jun 2022 19:05:08 +0200 Subject: [PATCH] Fix controls overlay --- Shared/Player/Controls/ControlsOverlay.swift | 15 ++++++++++----- Shared/Player/Controls/PlayerControls.swift | 1 - 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Shared/Player/Controls/ControlsOverlay.swift b/Shared/Player/Controls/ControlsOverlay.swift index b3ad1e8f..0937ee92 100644 --- a/Shared/Player/Controls/ControlsOverlay.swift +++ b/Shared/Player/Controls/ControlsOverlay.swift @@ -19,7 +19,9 @@ struct ControlsOverlay: View { rateButton increaseRateButton } + #if os(iOS) .foregroundColor(.white) + #endif if player.activeBackend == .mpv, showMPVPlaybackStats @@ -58,13 +60,13 @@ struct ControlsOverlay: View { } label: { Label("Increase rate", systemImage: "plus") .labelStyle(.iconOnly) - .padding(.horizontal, 8) + .padding(8) + .frame(height: 30) .contentShape(Rectangle()) } #if os(macOS) .buttonStyle(.bordered) #else - .frame(height: 30) .modifier(ControlBackgroundModifier()) .clipShape(RoundedRectangle(cornerRadius: 4)) #endif @@ -81,13 +83,13 @@ struct ControlsOverlay: View { } label: { Label("Decrease rate", systemImage: "minus") .labelStyle(.iconOnly) - .padding(.horizontal, 8) + .padding(8) + .frame(height: 30) .contentShape(Rectangle()) } #if os(macOS) .buttonStyle(.bordered) #else - .frame(height: 30) .modifier(ControlBackgroundModifier()) .clipShape(RoundedRectangle(cornerRadius: 4)) #endif @@ -112,6 +114,8 @@ struct ControlsOverlay: View { .frame(width: 140, height: 30) .foregroundColor(.primary) } + .transaction { t in t.animation = .none } + .buttonStyle(.plain) .foregroundColor(.primary) .frame(width: 140, height: 30) @@ -133,12 +137,13 @@ struct ControlsOverlay: View { Menu { ratePicker .frame(width: 100, height: 30) - .mask(RoundedRectangle(cornerRadius: 3)) } label: { Text(player.rateLabel(player.currentRate)) .foregroundColor(.primary) + .frame(width: 80) } + .transaction { t in t.animation = .none } .buttonStyle(.plain) .foregroundColor(.primary) .frame(width: 100, height: 30) diff --git a/Shared/Player/Controls/PlayerControls.swift b/Shared/Player/Controls/PlayerControls.swift index 5150d0fd..33874697 100644 --- a/Shared/Player/Controls/PlayerControls.swift +++ b/Shared/Player/Controls/PlayerControls.swift @@ -40,7 +40,6 @@ struct PlayerControls: View { buttonsBar if let video = player.currentVideo, player.playingFullScreen { -// if let video = Video.fixture { VStack(alignment: .leading, spacing: 8) { Text(video.title) .font(.title2.bold())