From 8978bf3f33bfc2f9c5de25fc5de96c28b073dd40 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 11 Nov 2022 16:19:14 +0100 Subject: [PATCH] Layout fixes --- Model/OpenVideosModel.swift | 2 ++ Shared/Settings/SettingsView.swift | 2 ++ Shared/Views/OpenVideosView.swift | 18 +++++++++++++----- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Model/OpenVideosModel.swift b/Model/OpenVideosModel.swift index a28d4135..8e4b1730 100644 --- a/Model/OpenVideosModel.swift +++ b/Model/OpenVideosModel.swift @@ -71,6 +71,8 @@ struct OpenVideosModel { return } + NavigationModel.shared.presentingOpenVideos = false + logger.info("opening \(urls.count) urls") urls.forEach { logger.info("\($0.absoluteString)") } diff --git a/Shared/Settings/SettingsView.swift b/Shared/Settings/SettingsView.swift index 6b7cda89..fa3e0734 100644 --- a/Shared/Settings/SettingsView.swift +++ b/Shared/Settings/SettingsView.swift @@ -266,6 +266,8 @@ struct SettingsView_Previews: PreviewProvider { .injectFixtureEnvironmentObjects() #if os(macOS) .frame(width: 600, height: 300) + #else + .navigationViewStyle(.stack) #endif } } diff --git a/Shared/Views/OpenVideosView.swift b/Shared/Views/OpenVideosView.swift index 0b15e910..da8343fe 100644 --- a/Shared/Views/OpenVideosView.swift +++ b/Shared/Views/OpenVideosView.swift @@ -33,6 +33,9 @@ struct OpenVideosView: View { } } .navigationTitle("Open Videos") + #if os(iOS) + .navigationBarTitleDisplayMode(.inline) + #endif } #endif } @@ -57,11 +60,16 @@ struct OpenVideosView: View { .font(.caption2) .foregroundColor(.secondary) - Picker("Playback Mode", selection: $playbackMode) { - ForEach(OpenVideosModel.PlaybackMode.allCases, id: \.rawValue) { mode in - Text(mode.description).tag(mode) + Menu { + Picker("Playback Mode", selection: $playbackMode) { + ForEach(OpenVideosModel.PlaybackMode.allCases, id: \.rawValue) { mode in + Text(mode.description).tag(mode) + } } + } label: { + Text(playbackMode.description) } + .transaction { t in t.disablesAnimations = true } .labelsHidden() .padding(.bottom, 5) .frame(maxWidth: .infinity, alignment: .center) @@ -128,7 +136,7 @@ struct OpenVideosView: View { } label: { HStack { Image(systemName: "network") - Text("Open URLs") + Text("Open") .fontWeight(.bold) .padding(.vertical, 10) } @@ -154,7 +162,7 @@ struct OpenVideosView: View { } label: { HStack { Image(systemName: "doc.on.clipboard.fill") - Text("Clipboard") + Text("Paste") .fontWeight(.bold) .padding(.vertical, 10) }