Show left-column icon and title for Home and Sidebar settings on tvOS

This commit is contained in:
Arkadiusz Fal
2026-04-16 19:18:49 +02:00
parent e2f3107833
commit 71dd956f18
3 changed files with 21 additions and 1 deletions

View File

@@ -43,7 +43,9 @@ struct HomeSettingsView: View {
#if os(iOS) #if os(iOS)
.environment(\.editMode, isEditMode ? .constant(.active) : .constant(.inactive)) .environment(\.editMode, isEditMode ? .constant(.active) : .constant(.inactive))
#endif #endif
#if !os(tvOS)
.navigationTitle(String(localized: "home.settings.title")) .navigationTitle(String(localized: "home.settings.title"))
#endif
#if os(iOS) #if os(iOS)
.navigationBarTitleDisplayMode(.inline) .navigationBarTitleDisplayMode(.inline)
#endif #endif

View File

@@ -79,7 +79,14 @@ private struct CustomizationSection: View {
var body: some View { var body: some View {
Section { Section {
NavigationLink { NavigationLink {
#if os(tvOS)
TVSidebarDetailContainer(
systemImage: SidebarItem.home.systemImage,
title: String(localized: "settings.appearance.home.customize")
) { HomeSettingsView() }
#else
HomeSettingsView() HomeSettingsView()
#endif
} label: { } label: {
Label(String(localized: "settings.appearance.home.customize"), systemImage: SidebarItem.home.systemImage) Label(String(localized: "settings.appearance.home.customize"), systemImage: SidebarItem.home.systemImage)
} }
@@ -101,12 +108,21 @@ private struct CustomizationSection: View {
} }
#endif #endif
#if os(macOS) || os(tvOS) #if os(macOS)
NavigationLink { NavigationLink {
SidebarSettingsView() SidebarSettingsView()
} label: { } label: {
Label(String(localized: "settings.sidebar.title"), systemImage: "sidebar.leading") Label(String(localized: "settings.sidebar.title"), systemImage: "sidebar.leading")
} }
#elseif os(tvOS)
NavigationLink {
TVSidebarDetailContainer(
systemImage: "sidebar.leading",
title: String(localized: "settings.sidebar.title")
) { SidebarSettingsView() }
} label: {
Label(String(localized: "settings.sidebar.title"), systemImage: "sidebar.leading")
}
#endif #endif
} }
} }

View File

@@ -136,7 +136,9 @@ struct SidebarSettingsView: View {
#if os(iOS) #if os(iOS)
.environment(\.editMode, .constant(.active)) .environment(\.editMode, .constant(.active))
#endif #endif
#if !os(tvOS)
.navigationTitle(String(localized: "settings.sidebar.title")) .navigationTitle(String(localized: "settings.sidebar.title"))
#endif
#if os(iOS) #if os(iOS)
.navigationBarTitleDisplayMode(.inline) .navigationBarTitleDisplayMode(.inline)
#endif #endif