diff --git a/Shared/Favorites/FavoriteItemView.swift b/Shared/Favorites/FavoriteItemView.swift index 683bcede..8c847cc9 100644 --- a/Shared/Favorites/FavoriteItemView.swift +++ b/Shared/Favorites/FavoriteItemView.swift @@ -55,14 +55,14 @@ struct FavoriteItemView: View { resource?.loadIfNeeded() } #if !os(tvOS) - .onDrag { - dragging = item - return NSItemProvider(object: item.id as NSString) - } - .onDrop( - of: [UTType.text], - delegate: DropFavorite(item: item, favorites: $favorites, current: $dragging) - ) + .onDrag { + dragging = item + return NSItemProvider(object: item.id as NSString) + } + .onDrop( + of: [UTType.text], + delegate: DropFavorite(item: item, favorites: $favorites, current: $dragging) + ) #endif } } diff --git a/Shared/Favorites/FavoritesView.swift b/Shared/Favorites/FavoritesView.swift index 8401fe0f..a018a3c9 100644 --- a/Shared/Favorites/FavoritesView.swift +++ b/Shared/Favorites/FavoritesView.swift @@ -51,8 +51,8 @@ struct FavoritesView: View { .navigationTitle("Favorites") #endif #if os(macOS) - .background() - .frame(minWidth: 360) + .background() + .frame(minWidth: 360) #endif } } diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift index 4eecf25a..f6964be2 100644 --- a/Shared/Navigation/ContentView.swift +++ b/Shared/Navigation/ContentView.swift @@ -53,46 +53,46 @@ struct ContentView: View { .environmentObject(navigation) } #if os(iOS) - .fullScreenCover(isPresented: $player.presentingPlayer) { - VideoPlayerView() - .environmentObject(accounts) - .environmentObject(instances) - .environmentObject(navigation) - .environmentObject(player) - .environmentObject(playlists) - .environmentObject(subscriptions) - .environmentObject(thumbnailsModel) - } + .fullScreenCover(isPresented: $player.presentingPlayer) { + VideoPlayerView() + .environmentObject(accounts) + .environmentObject(instances) + .environmentObject(navigation) + .environmentObject(player) + .environmentObject(playlists) + .environmentObject(subscriptions) + .environmentObject(thumbnailsModel) + } #elseif os(macOS) - .sheet(isPresented: $player.presentingPlayer) { - VideoPlayerView() - .frame(minWidth: 900, minHeight: 800) - .environmentObject(accounts) - .environmentObject(instances) - .environmentObject(navigation) - .environmentObject(player) - .environmentObject(playlists) - .environmentObject(subscriptions) - .environmentObject(thumbnailsModel) - } + .sheet(isPresented: $player.presentingPlayer) { + VideoPlayerView() + .frame(minWidth: 900, minHeight: 800) + .environmentObject(accounts) + .environmentObject(instances) + .environmentObject(navigation) + .environmentObject(player) + .environmentObject(playlists) + .environmentObject(subscriptions) + .environmentObject(thumbnailsModel) + } #endif #if !os(tvOS) - .handlesExternalEvents(preferring: Set(["*"]), allowing: Set(["*"])) - .onOpenURL(perform: handleOpenedURL) - .sheet(isPresented: $navigation.presentingAddToPlaylist) { - AddToPlaylistView(video: navigation.videoToAddToPlaylist) - .environmentObject(playlists) - } - .sheet(isPresented: $navigation.presentingPlaylistForm) { - PlaylistFormView(playlist: $navigation.editedPlaylist) - .environmentObject(accounts) - .environmentObject(playlists) - } - .sheet(isPresented: $navigation.presentingSettings, onDismiss: openWelcomeScreenIfAccountEmpty) { - SettingsView() - .environmentObject(accounts) - .environmentObject(instances) - } + .handlesExternalEvents(preferring: Set(["*"]), allowing: Set(["*"])) + .onOpenURL(perform: handleOpenedURL) + .sheet(isPresented: $navigation.presentingAddToPlaylist) { + AddToPlaylistView(video: navigation.videoToAddToPlaylist) + .environmentObject(playlists) + } + .sheet(isPresented: $navigation.presentingPlaylistForm) { + PlaylistFormView(playlist: $navigation.editedPlaylist) + .environmentObject(accounts) + .environmentObject(playlists) + } + .sheet(isPresented: $navigation.presentingSettings, onDismiss: openWelcomeScreenIfAccountEmpty) { + SettingsView() + .environmentObject(accounts) + .environmentObject(instances) + } #endif } diff --git a/Shared/Player/PlayerQueueView.swift b/Shared/Player/PlayerQueueView.swift index aa44e365..2110a5f5 100644 --- a/Shared/Player/PlayerQueueView.swift +++ b/Shared/Player/PlayerQueueView.swift @@ -22,17 +22,17 @@ struct PlayerQueueView: View { } } #if !os(iOS) - .padding(.vertical, 5) - .listRowInsets(EdgeInsets()) + .padding(.vertical, 5) + .listRowInsets(EdgeInsets()) #endif } #if os(macOS) - .listStyle(.inset) + .listStyle(.inset) #elseif os(iOS) - .listStyle(.grouped) + .listStyle(.grouped) #else - .listStyle(.plain) + .listStyle(.plain) #endif } diff --git a/Shared/Player/RelatedView.swift b/Shared/Player/RelatedView.swift index 71670ffd..d673dc23 100644 --- a/Shared/Player/RelatedView.swift +++ b/Shared/Player/RelatedView.swift @@ -14,11 +14,11 @@ struct RelatedView: View { } } #if os(macOS) - .listStyle(.inset) + .listStyle(.inset) #elseif os(iOS) - .listStyle(.grouped) + .listStyle(.grouped) #else - .listStyle(.plain) + .listStyle(.plain) #endif } } diff --git a/Shared/Player/VideoDetails.swift b/Shared/Player/VideoDetails.swift index 077df8f4..468ec27b 100644 --- a/Shared/Player/VideoDetails.swift +++ b/Shared/Player/VideoDetails.swift @@ -50,7 +50,7 @@ struct VideoDetails: View { toggleFullScreenDetailsButton } #if os(macOS) - .padding(.top, 10) + .padding(.top, 10) #endif if !video.isNil { @@ -188,7 +188,7 @@ struct VideoDetails: View { confirmationShown = true } #if os(iOS) - .tint(.gray) + .tint(.gray) #endif .confirmationDialog("Are you you want to unsubscribe from \(video!.channel.name)?", isPresented: $confirmationShown) { Button("Unsubscribe") { @@ -309,9 +309,9 @@ struct VideoDetails: View { } } #if os(iOS) - .sheet(isPresented: $presentingShareSheet) { - ShareSheet(activityItems: [shareURL]) - } + .sheet(isPresented: $presentingShareSheet) { + ShareSheet(activityItems: [shareURL]) + } #endif } diff --git a/Shared/Player/VideoDetailsPaddingModifier.swift b/Shared/Player/VideoDetailsPaddingModifier.swift index 23843f8a..ce159676 100644 --- a/Shared/Player/VideoDetailsPaddingModifier.swift +++ b/Shared/Player/VideoDetailsPaddingModifier.swift @@ -6,7 +6,7 @@ struct VideoDetailsPaddingModifier: ViewModifier { #if os(macOS) 30 #else - 35 + 40 #endif } diff --git a/Shared/Player/VideoPlayerSizeModifier.swift b/Shared/Player/VideoPlayerSizeModifier.swift index 65bcd079..ba7fd27c 100644 --- a/Shared/Player/VideoPlayerSizeModifier.swift +++ b/Shared/Player/VideoPlayerSizeModifier.swift @@ -46,7 +46,7 @@ struct VideoPlayerSizeModifier: ViewModifier { #if os(iOS) verticalSizeClass == .regular ? .fit : .fill #else - .fit + .fit #endif } diff --git a/Shared/Player/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift index 44095033..7bf09b5b 100644 --- a/Shared/Player/VideoPlayerView.swift +++ b/Shared/Player/VideoPlayerView.swift @@ -4,7 +4,7 @@ import Siesta import SwiftUI struct VideoPlayerView: View { - static let defaultAspectRatio: Double = 1.77777778 + static let defaultAspectRatio = 16 / 9.0 static var defaultMinimumHeightLeft: Double { #if os(macOS) 300 @@ -76,14 +76,14 @@ struct VideoPlayerView: View { } } #if os(iOS) - .onSwipeGesture( - up: { - withAnimation { - fullScreen = true - } - }, - down: { dismiss() } - ) + .onSwipeGesture( + up: { + withAnimation { + fullScreen = true + } + }, + down: { dismiss() } + ) #endif .background(.black) @@ -104,7 +104,7 @@ struct VideoPlayerView: View { #endif } #if os(macOS) - .frame(minWidth: 650) + .frame(minWidth: 650) #endif #if os(iOS) if sidebarQueue { diff --git a/Shared/Playlists/AddToPlaylistView.swift b/Shared/Playlists/AddToPlaylistView.swift index 39b9e7fa..4304eb6f 100644 --- a/Shared/Playlists/AddToPlaylistView.swift +++ b/Shared/Playlists/AddToPlaylistView.swift @@ -33,13 +33,13 @@ struct AddToPlaylistView: View { } } #if os(macOS) - .frame(width: 500, height: 270) - .padding(.vertical) + .frame(width: 500, height: 270) + .padding(.vertical) #elseif os(tvOS) - .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) - .background(.thickMaterial) + .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) + .background(.thickMaterial) #else - .padding(.vertical) + .padding(.vertical) #endif } @@ -47,7 +47,7 @@ struct AddToPlaylistView: View { #if os(tvOS) 600 #else - .infinity + .infinity #endif } diff --git a/Shared/Playlists/PlaylistFormView.swift b/Shared/Playlists/PlaylistFormView.swift index cc1650d6..f14b629c 100644 --- a/Shared/Playlists/PlaylistFormView.swift +++ b/Shared/Playlists/PlaylistFormView.swift @@ -46,7 +46,7 @@ struct PlaylistFormView: View { .pickerStyle(.segmented) } #if os(macOS) - .padding(.horizontal) + .padding(.horizontal) #endif HStack { @@ -225,7 +225,7 @@ struct PlaylistFormView: View { ) } #if os(macOS) - .foregroundColor(.red) + .foregroundColor(.red) #endif } diff --git a/Shared/Playlists/PlaylistsView.swift b/Shared/Playlists/PlaylistsView.swift index 56c6844a..5e8b9d12 100644 --- a/Shared/Playlists/PlaylistsView.swift +++ b/Shared/Playlists/PlaylistsView.swift @@ -49,73 +49,73 @@ struct PlaylistsView: View { } } #if os(tvOS) - .fullScreenCover(isPresented: $showingNewPlaylist, onDismiss: selectCreatedPlaylist) { - PlaylistFormView(playlist: $createdPlaylist) - .environmentObject(accounts) - } - .fullScreenCover(isPresented: $showingEditPlaylist, onDismiss: selectEditedPlaylist) { - PlaylistFormView(playlist: $editedPlaylist) - .environmentObject(accounts) - } + .fullScreenCover(isPresented: $showingNewPlaylist, onDismiss: selectCreatedPlaylist) { + PlaylistFormView(playlist: $createdPlaylist) + .environmentObject(accounts) + } + .fullScreenCover(isPresented: $showingEditPlaylist, onDismiss: selectEditedPlaylist) { + PlaylistFormView(playlist: $editedPlaylist) + .environmentObject(accounts) + } #else - .sheet(isPresented: $showingNewPlaylist, onDismiss: selectCreatedPlaylist) { - PlaylistFormView(playlist: $createdPlaylist) - .environmentObject(accounts) - } - .sheet(isPresented: $showingEditPlaylist, onDismiss: selectEditedPlaylist) { - PlaylistFormView(playlist: $editedPlaylist) - .environmentObject(accounts) - } - #endif - .toolbar { - ToolbarItemGroup { - #if !os(iOS) - if !model.isEmpty { - selectPlaylistButton - .prefersDefaultFocus(in: focusNamespace) - } - - if currentPlaylist != nil { - editPlaylistButton - } - #endif - FavoriteButton(item: FavoriteItem(section: .playlist(selectedPlaylistID))) - - newPlaylistButton - } - - #if os(iOS) - ToolbarItemGroup(placement: .bottomBar) { - Group { - if model.isEmpty { - Text("No Playlists") - .foregroundColor(.secondary) - } else { - Text("Current Playlist") - .foregroundColor(.secondary) - - selectPlaylistButton - } - - Spacer() - - if currentPlaylist != nil { - editPlaylistButton - } - } - .transaction { t in t.animation = .none } + .sheet(isPresented: $showingNewPlaylist, onDismiss: selectCreatedPlaylist) { + PlaylistFormView(playlist: $createdPlaylist) + .environmentObject(accounts) + } + .sheet(isPresented: $showingEditPlaylist, onDismiss: selectEditedPlaylist) { + PlaylistFormView(playlist: $editedPlaylist) + .environmentObject(accounts) } - #endif - } - #if os(tvOS) - .focusScope(focusNamespace) #endif - .onAppear { - model.load() - } - .onChange(of: accounts.current) { _ in - model.load(force: true) - } + .toolbar { + ToolbarItemGroup { + #if !os(iOS) + if !model.isEmpty { + selectPlaylistButton + .prefersDefaultFocus(in: focusNamespace) + } + + if currentPlaylist != nil { + editPlaylistButton + } + #endif + FavoriteButton(item: FavoriteItem(section: .playlist(selectedPlaylistID))) + + newPlaylistButton + } + + #if os(iOS) + ToolbarItemGroup(placement: .bottomBar) { + Group { + if model.isEmpty { + Text("No Playlists") + .foregroundColor(.secondary) + } else { + Text("Current Playlist") + .foregroundColor(.secondary) + + selectPlaylistButton + } + + Spacer() + + if currentPlaylist != nil { + editPlaylistButton + } + } + .transaction { t in t.animation = .none } + } + #endif + } + #if os(tvOS) + .focusScope(focusNamespace) + #endif + .onAppear { + model.load() + } + .onChange(of: accounts.current) { _ in + model.load(force: true) + } } #if os(tvOS) diff --git a/Shared/Settings/AccountForm.swift b/Shared/Settings/AccountForm.swift index f723bdc7..86a6de95 100644 --- a/Shared/Settings/AccountForm.swift +++ b/Shared/Settings/AccountForm.swift @@ -29,12 +29,12 @@ struct AccountForm: View { .frame(maxWidth: 1000) } #if os(iOS) - .padding(.vertical) + .padding(.vertical) #elseif os(tvOS) - .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) - .background(.thickMaterial) + .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) + .background(.thickMaterial) #else - .frame(width: 400, height: 145) + .frame(width: 400, height: 145) #endif } @@ -49,7 +49,7 @@ struct AccountForm: View { dismiss() } #if !os(tvOS) - .keyboardShortcut(.cancelAction) + .keyboardShortcut(.cancelAction) #endif } .padding(.horizontal) @@ -61,7 +61,7 @@ struct AccountForm: View { Form { formFields #if os(macOS) - .padding(.horizontal) + .padding(.horizontal) #endif } #else @@ -97,7 +97,7 @@ struct AccountForm: View { #if os(tvOS) .padding(.top, 30) #endif - .padding(.horizontal) + .padding(.horizontal) } private func initializeForm() { diff --git a/Shared/Settings/AccountsSettings.swift b/Shared/Settings/AccountsSettings.swift index 998769f5..17542f8a 100644 --- a/Shared/Settings/AccountsSettings.swift +++ b/Shared/Settings/AccountsSettings.swift @@ -46,7 +46,7 @@ struct AccountsSettings: View { } } #if os(tvOS) - .frame(maxWidth: 1000) + .frame(maxWidth: 1000) #endif .navigationTitle(instance.description) @@ -78,7 +78,7 @@ struct AccountsSettings: View { AccountForm(instance: instance) } #if !os(tvOS) - .listStyle(.insetGrouped) + .listStyle(.insetGrouped) #endif } diff --git a/Shared/Settings/InstanceForm.swift b/Shared/Settings/InstanceForm.swift index 4e141992..ae1c7448 100644 --- a/Shared/Settings/InstanceForm.swift +++ b/Shared/Settings/InstanceForm.swift @@ -52,7 +52,7 @@ struct InstanceForm: View { dismiss() } #if !os(tvOS) - .keyboardShortcut(.cancelAction) + .keyboardShortcut(.cancelAction) #endif } .padding(.horizontal) @@ -63,7 +63,7 @@ struct InstanceForm: View { Form { formFields #if os(macOS) - .padding(.horizontal) + .padding(.horizontal) #endif } #else @@ -105,7 +105,7 @@ struct InstanceForm: View { #endif } #if os(tvOS) - .padding(.top, 30) + .padding(.top, 30) #endif .padding(.horizontal) } diff --git a/Shared/Settings/InstancesSettings.swift b/Shared/Settings/InstancesSettings.swift index cb5bdf87..83bc1528 100644 --- a/Shared/Settings/InstancesSettings.swift +++ b/Shared/Settings/InstancesSettings.swift @@ -22,21 +22,21 @@ struct InstancesSettings: View { } } #if os(iOS) - .swipeActions(edge: .trailing, allowsFullSwipe: false) { - removeInstanceButton(instance) - } - .buttonStyle(.plain) + .swipeActions(edge: .trailing, allowsFullSwipe: false) { + removeInstanceButton(instance) + } + .buttonStyle(.plain) #else - .contextMenu { - removeInstanceButton(instance) - } + .contextMenu { + removeInstanceButton(instance) + } #endif } addInstanceButton } #if os(iOS) - .listStyle(.insetGrouped) + .listStyle(.insetGrouped) #endif } .sheet(isPresented: $presentingInstanceForm) { diff --git a/Shared/Settings/ServicesSettings.swift b/Shared/Settings/ServicesSettings.swift index 46a41964..40044384 100644 --- a/Shared/Settings/ServicesSettings.swift +++ b/Shared/Settings/ServicesSettings.swift @@ -87,7 +87,7 @@ struct ServicesSettings: View { .contentShape(Rectangle()) } #if !os(tvOS) - .buttonStyle(.plain) + .buttonStyle(.plain) #endif } } diff --git a/Shared/Settings/SettingsView.swift b/Shared/Settings/SettingsView.swift index feac890c..146d3f72 100644 --- a/Shared/Settings/SettingsView.swift +++ b/Shared/Settings/SettingsView.swift @@ -84,7 +84,7 @@ struct SettingsView: View { #endif } #if os(tvOS) - .background(.black) + .background(.black) #endif #endif } diff --git a/Shared/Trending/TrendingCountry.swift b/Shared/Trending/TrendingCountry.swift index 12a471db..fa99a3cb 100644 --- a/Shared/Trending/TrendingCountry.swift +++ b/Shared/Trending/TrendingCountry.swift @@ -48,7 +48,7 @@ struct TrendingCountry: View { .searchable(text: $query, placement: searchPlacement, prompt: Text(TrendingCountry.prompt)) #endif #if os(tvOS) - .background(.thinMaterial) + .background(.thinMaterial) #endif } @@ -72,8 +72,8 @@ struct TrendingCountry: View { } #if os(macOS) - .listStyle(.inset(alternatesRowBackgrounds: true)) - .padding(.bottom, 5) + .listStyle(.inset(alternatesRowBackgrounds: true)) + .padding(.bottom, 5) #endif } diff --git a/Shared/Trending/TrendingView.swift b/Shared/Trending/TrendingView.swift index ecddeaa5..0979703a 100644 --- a/Shared/Trending/TrendingView.swift +++ b/Shared/Trending/TrendingView.swift @@ -49,79 +49,79 @@ struct TrendingView: View { } } #if os(tvOS) - .fullScreenCover(isPresented: $presentingCountrySelection) { - TrendingCountry(selectedCountry: $country) - } + .fullScreenCover(isPresented: $presentingCountrySelection) { + TrendingCountry(selectedCountry: $country) + } #else - .sheet(isPresented: $presentingCountrySelection) { - TrendingCountry(selectedCountry: $country) - #if os(macOS) - .frame(minWidth: 400, minHeight: 400) - #endif - } - .navigationTitle("Trending") - #endif - .toolbar { - #if os(macOS) - ToolbarItemGroup { - if let favoriteItem = favoriteItem { - FavoriteButton(item: favoriteItem) - .id(favoriteItem.id) - } - - if accounts.app.supportsTrendingCategories { - categoryButton - } - countryButton + .sheet(isPresented: $presentingCountrySelection) { + TrendingCountry(selectedCountry: $country) + #if os(macOS) + .frame(minWidth: 400, minHeight: 400) + #endif } - #elseif os(iOS) - ToolbarItemGroup(placement: .bottomBar) { - Group { - HStack { - if accounts.app.supportsTrendingCategories { - Text("Category") - .foregroundColor(.secondary) - - categoryButton - // only way to disable Menu animation is to - // force redraw of the view when it changes - .id(UUID()) + .navigationTitle("Trending") + #endif + .toolbar { + #if os(macOS) + ToolbarItemGroup { + if let favoriteItem = favoriteItem { + FavoriteButton(item: favoriteItem) + .id(favoriteItem.id) } - } - - Spacer() - - if let favoriteItem = favoriteItem { - FavoriteButton(item: favoriteItem) - .id(favoriteItem.id) - - Spacer() - } - - HStack { - Text("Country") - .foregroundColor(.secondary) + if accounts.app.supportsTrendingCategories { + categoryButton + } countryButton } - } - } - #endif - } - .onChange(of: resource) { _ in - resource.load() - updateFavoriteItem() - } - .onAppear { - if videos.isEmpty { - resource.addObserver(store) - resource.loadIfNeeded() - } else { - store.replace(videos) - } + #elseif os(iOS) + ToolbarItemGroup(placement: .bottomBar) { + Group { + HStack { + if accounts.app.supportsTrendingCategories { + Text("Category") + .foregroundColor(.secondary) - updateFavoriteItem() - } + categoryButton + // only way to disable Menu animation is to + // force redraw of the view when it changes + .id(UUID()) + } + } + + Spacer() + + if let favoriteItem = favoriteItem { + FavoriteButton(item: favoriteItem) + .id(favoriteItem.id) + + Spacer() + } + + HStack { + Text("Country") + .foregroundColor(.secondary) + + countryButton + } + } + } + #endif + } + .onChange(of: resource) { _ in + resource.load() + updateFavoriteItem() + } + .onAppear { + if videos.isEmpty { + resource.addObserver(store) + resource.loadIfNeeded() + } else { + store.replace(videos) + } + + updateFavoriteItem() + } } private var toolbar: some View { diff --git a/Shared/Videos/HorizontalCells.swift b/Shared/Videos/HorizontalCells.swift index 003a0393..5fbedd59 100644 --- a/Shared/Videos/HorizontalCells.swift +++ b/Shared/Videos/HorizontalCells.swift @@ -22,11 +22,11 @@ struct HorizontalCells: View { } } #if os(tvOS) - .padding(.horizontal, 40) - .padding(.vertical, 30) + .padding(.horizontal, 40) + .padding(.vertical, 30) #else - .padding(.horizontal, 15) - .padding(.vertical, 10) + .padding(.horizontal, 15) + .padding(.vertical, 10) #endif } .frame(height: cellHeight) diff --git a/Shared/Videos/VideoBanner.swift b/Shared/Videos/VideoBanner.swift index b4d7ccf2..848bb752 100644 --- a/Shared/Videos/VideoBanner.swift +++ b/Shared/Videos/VideoBanner.swift @@ -58,7 +58,7 @@ struct VideoBanner: View { #if os(macOS) playbackTime.isNil ? .center : .top #else - .center + .center #endif } diff --git a/Shared/Videos/VideoCell.swift b/Shared/Videos/VideoCell.swift index 16ca7868..8a7a0a5a 100644 --- a/Shared/Videos/VideoCell.swift +++ b/Shared/Videos/VideoCell.swift @@ -56,7 +56,7 @@ struct VideoCell: View { #endif } #if os(macOS) - .background() + .background() #endif } @@ -171,11 +171,11 @@ struct VideoCell: View { .frame(minWidth: 0, maxWidth: .infinity, alignment: .leading) } #if os(tvOS) - .frame(minHeight: channelOnThumbnail ? 80 : 120, alignment: .top) + .frame(minHeight: channelOnThumbnail ? 80 : 120, alignment: .top) #elseif os(macOS) - .frame(minHeight: 35, alignment: .top) + .frame(minHeight: 35, alignment: .top) #else - .frame(minHeight: 50, alignment: .top) + .frame(minHeight: 50, alignment: .top) #endif .padding(.bottom, 4) @@ -316,9 +316,9 @@ struct VideoCell_Preview: PreviewProvider { VideoCell(video: Video.fixture) } #if os(macOS) - .frame(maxWidth: 300, maxHeight: 250) + .frame(maxWidth: 300, maxHeight: 250) #elseif os(iOS) - .frame(maxWidth: 300, maxHeight: 200) + .frame(maxWidth: 300, maxHeight: 200) #endif .injectFixtureEnvironmentObjects() } diff --git a/Shared/Views/ChannelPlaylistView.swift b/Shared/Views/ChannelPlaylistView.swift index 6edbca3b..6adffb15 100644 --- a/Shared/Views/ChannelPlaylistView.swift +++ b/Shared/Views/ChannelPlaylistView.swift @@ -54,33 +54,33 @@ struct ChannelPlaylistView: View { VerticalCells(items: items) } #if os(iOS) - .sheet(isPresented: $presentingShareSheet) { - if let url = accounts.api.shareURL(contentItem) { - ShareSheet(activityItems: [url]) - } + .sheet(isPresented: $presentingShareSheet) { + if let url = accounts.api.shareURL(contentItem) { + ShareSheet(activityItems: [url]) } + } #endif .onAppear { resource?.addObserver(store) resource?.loadIfNeeded() } #if !os(tvOS) - .toolbar { - ToolbarItem(placement: .navigation) { - ShareButton( - contentItem: contentItem, - presentingShareSheet: $presentingShareSheet - ) - } - - ToolbarItem { - FavoriteButton(item: FavoriteItem(section: .channelPlaylist(playlist.id, playlist.title))) - } + .toolbar { + ToolbarItem(placement: .navigation) { + ShareButton( + contentItem: contentItem, + presentingShareSheet: $presentingShareSheet + ) } - .navigationTitle(playlist.title) + + ToolbarItem { + FavoriteButton(item: FavoriteItem(section: .channelPlaylist(playlist.id, playlist.title))) + } + } + .navigationTitle(playlist.title) #else - .background(.thickMaterial) + .background(.thickMaterial) #endif } diff --git a/Shared/Views/ChannelVideosView.swift b/Shared/Views/ChannelVideosView.swift index ef988791..eea3fcc3 100644 --- a/Shared/Views/ChannelVideosView.swift +++ b/Shared/Views/ChannelVideosView.swift @@ -75,44 +75,44 @@ struct ChannelVideosView: View { .focusScope(focusNamespace) #endif #if !os(tvOS) - .toolbar { - ToolbarItem(placement: .navigation) { - ShareButton( - contentItem: contentItem, - presentingShareSheet: $presentingShareSheet - ) - } + .toolbar { + ToolbarItem(placement: .navigation) { + ShareButton( + contentItem: contentItem, + presentingShareSheet: $presentingShareSheet + ) + } - ToolbarItem { - HStack { - Text("**\(store.item?.subscriptionsString ?? "loading")** subscribers") - .foregroundColor(.secondary) - .opacity(store.item?.subscriptionsString != nil ? 1 : 0) + ToolbarItem { + HStack { + Text("**\(store.item?.subscriptionsString ?? "loading")** subscribers") + .foregroundColor(.secondary) + .opacity(store.item?.subscriptionsString != nil ? 1 : 0) - subscriptionToggleButton + subscriptionToggleButton - FavoriteButton(item: FavoriteItem(section: .channel(channel.id, channel.name))) - } + FavoriteButton(item: FavoriteItem(section: .channel(channel.id, channel.name))) } } + } #else - .background(.thickMaterial) + .background(.thickMaterial) #endif #if os(iOS) - .sheet(isPresented: $presentingShareSheet) { - if let url = accounts.api.shareURL(contentItem) { - ShareSheet(activityItems: [url]) - } + .sheet(isPresented: $presentingShareSheet) { + if let url = accounts.api.shareURL(contentItem) { + ShareSheet(activityItems: [url]) } + } #endif .modifier(UnsubscribeAlertModifier()) - .onAppear { - if store.item.isNil { - resource.addObserver(store) - resource.load() - } + .onAppear { + if store.item.isNil { + resource.addObserver(store) + resource.load() } - .navigationTitle(navigationTitle) + } + .navigationTitle(navigationTitle) } private var resource: Resource { diff --git a/Shared/Views/PlayerControlsView.swift b/Shared/Views/PlayerControlsView.swift index 20a3a7e4..ae0d379c 100644 --- a/Shared/Views/PlayerControlsView.swift +++ b/Shared/Views/PlayerControlsView.swift @@ -14,8 +14,8 @@ struct PlayerControlsView: View { ZStack(alignment: .bottomLeading) { content #if !os(tvOS) - .frame(minHeight: 0, maxHeight: .infinity) - .padding(.bottom, 50) + .frame(minHeight: 0, maxHeight: .infinity) + .padding(.bottom, 50) #endif #if !os(tvOS) diff --git a/Shared/Views/SearchView.swift b/Shared/Views/SearchView.swift index 3c3bd8b9..cfc7eccd 100644 --- a/Shared/Views/SearchView.swift +++ b/Shared/Views/SearchView.swift @@ -142,7 +142,7 @@ struct SearchView: View { state.changeQuery { query in query.duration = duration } } #if !os(tvOS) - .navigationTitle("Search") + .navigationTitle("Search") #endif } @@ -194,13 +194,13 @@ struct SearchView: View { state.changeQuery { query in query.query = item.title } } #if os(iOS) - .swipeActions(edge: .trailing) { - deleteButton(item) - } + .swipeActions(edge: .trailing) { + deleteButton(item) + } #elseif os(tvOS) - .contextMenu { - deleteButton(item) - } + .contextMenu { + deleteButton(item) + } #endif } } @@ -212,7 +212,7 @@ struct SearchView: View { } } #if os(iOS) - .listStyle(.insetGrouped) + .listStyle(.insetGrouped) #endif } diff --git a/Shared/Views/SignInRequiredView.swift b/Shared/Views/SignInRequiredView.swift index 43fe259e..d8585ebc 100644 --- a/Shared/Views/SignInRequiredView.swift +++ b/Shared/Views/SignInRequiredView.swift @@ -23,7 +23,7 @@ struct SignInRequiredView: View { } } #if !os(tvOS) - .navigationTitle(title) + .navigationTitle(title) #endif } diff --git a/Shared/YatteeApp.swift b/Shared/YatteeApp.swift index 9ebe511b..44be5744 100644 --- a/Shared/YatteeApp.swift +++ b/Shared/YatteeApp.swift @@ -12,11 +12,11 @@ struct YatteeApp: App { ContentView() } #if !os(tvOS) - .handlesExternalEvents(matching: Set(["*"])) - .commands { - SidebarCommands() - CommandGroup(replacing: .newItem, addition: {}) - } + .handlesExternalEvents(matching: Set(["*"])) + .commands { + SidebarCommands() + CommandGroup(replacing: .newItem, addition: {}) + } #endif #if os(macOS)