diff --git a/Yattee/Views/Navigation/UnifiedTabView.swift b/Yattee/Views/Navigation/UnifiedTabView.swift index d2982e03..f86526eb 100644 --- a/Yattee/Views/Navigation/UnifiedTabView.swift +++ b/Yattee/Views/Navigation/UnifiedTabView.swift @@ -752,7 +752,7 @@ struct UnifiedTabView: View { case .openURL: Tab(value: SidebarItem.openURL) { NavigationStack(path: $openURLPath) { - TVSettingsContainer( + TVSidebarDetailContainer( systemImage: SidebarItem.openURL.systemImage, title: SidebarItem.openURL.title ) { @@ -767,7 +767,7 @@ struct UnifiedTabView: View { case .remoteControl: Tab(value: SidebarItem.remoteControl) { NavigationStack(path: $remoteControlPath) { - TVSettingsContainer( + TVSidebarDetailContainer( systemImage: SidebarItem.remoteControl.systemImage, title: SidebarItem.remoteControl.title ) { diff --git a/Yattee/Views/Settings/SettingsView.swift b/Yattee/Views/Settings/SettingsView.swift index e70c7458..1dd2a8bd 100644 --- a/Yattee/Views/Settings/SettingsView.swift +++ b/Yattee/Views/Settings/SettingsView.swift @@ -93,7 +93,7 @@ struct SettingsView: View { List { if let appEnvironment { NavigationLink { - TVSettingsContainer(systemImage: "server.rack", title: String(localized: "sources.title")) { SourcesListView() } + TVSidebarDetailContainer(systemImage: "server.rack", title: String(localized: "sources.title")) { SourcesListView() } } label: { HStack { Label(String(localized: "sources.title"), systemImage: "server.rack") @@ -107,7 +107,7 @@ struct SettingsView: View { .accessibilityIdentifier("settings.row.sources") NavigationLink { - TVSettingsContainer(systemImage: "icloud", title: String(localized: "settings.icloud.title")) { iCloudSettingsView() } + TVSidebarDetailContainer(systemImage: "icloud", title: String(localized: "settings.icloud.title")) { iCloudSettingsView() } } label: { HStack { Label(String(localized: "settings.icloud.title"), systemImage: "icloud") @@ -123,33 +123,33 @@ struct SettingsView: View { } } - NavigationLink { TVSettingsContainer(systemImage: "paintbrush", title: String(localized: "settings.appearance.sectionTitle")) { AppearanceSettingsView() } } label: { + NavigationLink { TVSidebarDetailContainer(systemImage: "paintbrush", title: String(localized: "settings.appearance.sectionTitle")) { AppearanceSettingsView() } } label: { Label(String(localized: "settings.appearance.sectionTitle"), systemImage: "paintbrush") } - NavigationLink { TVSettingsContainer(systemImage: "hand.tap", title: String(localized: "settings.layoutNavigation.title")) { LayoutNavigationSettingsView() } } label: { + NavigationLink { TVSidebarDetailContainer(systemImage: "hand.tap", title: String(localized: "settings.layoutNavigation.title")) { LayoutNavigationSettingsView() } } label: { Label(String(localized: "settings.layoutNavigation.title"), systemImage: "hand.tap") } - NavigationLink { TVSettingsContainer(systemImage: "play.circle", title: String(localized: "settings.playback.sectionTitle")) { PlaybackSettingsView() } } label: { + NavigationLink { TVSidebarDetailContainer(systemImage: "play.circle", title: String(localized: "settings.playback.sectionTitle")) { PlaybackSettingsView() } } label: { Label(String(localized: "settings.playback.sectionTitle"), systemImage: "play.circle") } - NavigationLink { TVSettingsContainer(systemImage: "hand.raised", title: String(localized: "settings.privacy.title")) { PrivacySettingsView() } } label: { + NavigationLink { TVSidebarDetailContainer(systemImage: "hand.raised", title: String(localized: "settings.privacy.title")) { PrivacySettingsView() } } label: { Label(String(localized: "settings.privacy.title"), systemImage: "hand.raised") } - NavigationLink { TVSettingsContainer(systemImage: "gearshape.2", title: String(localized: "settings.advanced.title")) { AdvancedSettingsView() } } label: { + NavigationLink { TVSidebarDetailContainer(systemImage: "gearshape.2", title: String(localized: "settings.advanced.title")) { AdvancedSettingsView() } } label: { Label(String(localized: "settings.advanced.title"), systemImage: "gearshape.2") } if appEnvironment.instancesManager.enabledInstances.contains(where: \.isYouTubeInstance) { - NavigationLink { TVSettingsContainer(systemImage: "play.rectangle", title: String(localized: "settings.youtubeEnhancements.title")) { YouTubeEnhancementsSettingsView() } } label: { + NavigationLink { TVSidebarDetailContainer(systemImage: "play.rectangle", title: String(localized: "settings.youtubeEnhancements.title")) { YouTubeEnhancementsSettingsView() } } label: { Label(String(localized: "settings.youtubeEnhancements.title"), systemImage: "play.rectangle") } } - NavigationLink { TVSettingsContainer(systemImage: "info.circle", title: String(localized: "settings.about.title")) { AboutView() } } label: { + NavigationLink { TVSidebarDetailContainer(systemImage: "info.circle", title: String(localized: "settings.about.title")) { AboutView() } } label: { Label(String(localized: "settings.about.title"), systemImage: "info.circle") } } @@ -384,10 +384,10 @@ enum SettingsSection: String, CaseIterable, Identifiable { } } -// MARK: - tvOS Settings Container +// MARK: - tvOS Sidebar Detail Container #if os(tvOS) -struct TVSettingsContainer: View { +struct TVSidebarDetailContainer: View { let content: Content var systemImage: String? var title: String? diff --git a/Yattee/Views/Settings/SourcesListView.swift b/Yattee/Views/Settings/SourcesListView.swift index 097d0938..b2a5b3e5 100644 --- a/Yattee/Views/Settings/SourcesListView.swift +++ b/Yattee/Views/Settings/SourcesListView.swift @@ -60,7 +60,7 @@ struct SourcesListView: View { } #if os(tvOS) .navigationDestination(isPresented: $showingAddSheet) { - TVSettingsContainer(systemImage: "plus.circle", title: String(localized: "sources.newSource")) { AddSourceView() } + TVSidebarDetailContainer(systemImage: "plus.circle", title: String(localized: "sources.newSource")) { AddSourceView() } } #else .sheet(isPresented: $showingAddSheet) { @@ -69,7 +69,7 @@ struct SourcesListView: View { #endif #if os(tvOS) .navigationDestination(item: $sourceToEdit) { source in - TVSettingsContainer(systemImage: "pencil.circle", title: String(localized: "sources.editSource")) { EditSourceView(source: source) } + TVSidebarDetailContainer(systemImage: "pencil.circle", title: String(localized: "sources.editSource")) { EditSourceView(source: source) } } #else .sheet(item: $sourceToEdit) { source in