Fix preferences post preview background on macOS

This commit is contained in:
Shadowfacts 2024-04-15 11:04:33 -04:00
parent c43c951b92
commit 1f9806d02f
1 changed files with 17 additions and 1 deletions

View File

@ -49,7 +49,7 @@ struct AppearancePrefsView: View {
.padding(.top, 8) .padding(.top, 8)
.padding(.horizontal, UIDevice.current.userInterfaceIdiom == .pad ? 8 : 4) .padding(.horizontal, UIDevice.current.userInterfaceIdiom == .pad ? 8 : 4)
} }
.listRowBackground(preferences.pureBlackDarkMode ? colorScheme == .dark ? Color.black : Color.white : Color.appBackground) .listRowBackground(mockStatusBackground)
accountsSection accountsSection
postsSection postsSection
@ -60,6 +60,22 @@ struct AppearancePrefsView: View {
.navigationTitle("Appearance") .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 { private var themeSection: some View {
Section { Section {
#if !os(visionOS) #if !os(visionOS)