From 1f9806d02face6b734c36159e11660222cbcebfa Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 15 Apr 2024 11:04:33 -0400 Subject: [PATCH] Fix preferences post preview background on macOS --- .../Appearance/AppearancePrefsView.swift | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Preferences/Appearance/AppearancePrefsView.swift b/Tusker/Screens/Preferences/Appearance/AppearancePrefsView.swift index 3643de2828..35e8361890 100644 --- a/Tusker/Screens/Preferences/Appearance/AppearancePrefsView.swift +++ b/Tusker/Screens/Preferences/Appearance/AppearancePrefsView.swift @@ -49,7 +49,7 @@ struct AppearancePrefsView: View { .padding(.top, 8) .padding(.horizontal, UIDevice.current.userInterfaceIdiom == .pad ? 8 : 4) } - .listRowBackground(preferences.pureBlackDarkMode ? colorScheme == .dark ? Color.black : Color.white : Color.appBackground) + .listRowBackground(mockStatusBackground) accountsSection postsSection @@ -60,6 +60,22 @@ struct AppearancePrefsView: View { .navigationTitle("Appearance") } + private var mockStatusBackground: Color? { + #if targetEnvironment(macCatalyst) + nil + #else + if ProcessInfo.processInfo.isiOSAppOnMac { + nil + } else if !preferences.pureBlackDarkMode { + .appBackground + } else if colorScheme == .dark { + .black + } else { + .white + } + #endif + } + private var themeSection: some View { Section { #if !os(visionOS)