mirror of
https://github.com/yattee/yattee.git
synced 2026-04-10 01:26:57 +00:00
Hide theme and accent color settings on tvOS
These settings don't work well on Apple TV, so exclude the ThemeSection, AccentColorSection, and the .preferredColorScheme/.tint modifiers from tvOS builds.
This commit is contained in:
@@ -14,7 +14,9 @@ struct AppearanceSettingsView: View {
|
|||||||
Form {
|
Form {
|
||||||
if let settings = appEnvironment?.settingsManager {
|
if let settings = appEnvironment?.settingsManager {
|
||||||
// Theme section
|
// Theme section
|
||||||
|
#if !os(tvOS)
|
||||||
ThemeSection(settings: settings)
|
ThemeSection(settings: settings)
|
||||||
|
#endif
|
||||||
|
|
||||||
// App icon section (iOS only)
|
// App icon section (iOS only)
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
@@ -22,7 +24,9 @@ struct AppearanceSettingsView: View {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Accent color section
|
// Accent color section
|
||||||
|
#if !os(tvOS)
|
||||||
AccentColorSection(settings: settings)
|
AccentColorSection(settings: settings)
|
||||||
|
#endif
|
||||||
|
|
||||||
// List style section
|
// List style section
|
||||||
ListStyleSection(settings: settings)
|
ListStyleSection(settings: settings)
|
||||||
|
|||||||
@@ -60,8 +60,10 @@ struct YatteeApp: App {
|
|||||||
WindowGroup {
|
WindowGroup {
|
||||||
ContentView()
|
ContentView()
|
||||||
.appEnvironment(appEnvironment)
|
.appEnvironment(appEnvironment)
|
||||||
|
#if !os(tvOS)
|
||||||
.preferredColorScheme(appEnvironment.settingsManager.theme.colorScheme)
|
.preferredColorScheme(appEnvironment.settingsManager.theme.colorScheme)
|
||||||
.tint(appEnvironment.settingsManager.accentColor.color)
|
.tint(appEnvironment.settingsManager.accentColor.color)
|
||||||
|
#endif
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
// Required on the view to prevent new windows on URL open
|
// Required on the view to prevent new windows on URL open
|
||||||
.handlesExternalEvents(preferring: ["*"], allowing: ["*"])
|
.handlesExternalEvents(preferring: ["*"], allowing: ["*"])
|
||||||
|
|||||||
Reference in New Issue
Block a user