From 50c4ee8d67f4ef3e7e62e1b21c3dde48230dcaef Mon Sep 17 00:00:00 2001 From: mulan xia Date: Thu, 1 Feb 2024 19:51:55 -0500 Subject: [PATCH] fix system panel color background --- src/views/dialogs/DisplaySettingsDialog.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/dialogs/DisplaySettingsDialog.tsx b/src/views/dialogs/DisplaySettingsDialog.tsx index bb47d11..6cf492c 100644 --- a/src/views/dialogs/DisplaySettingsDialog.tsx +++ b/src/views/dialogs/DisplaySettingsDialog.tsx @@ -67,7 +67,12 @@ export const DisplaySettingsDialog = ({ setIsOpen }: ElementProps) => { label: STRING_KEYS.LIGHT, }, ].map(({ themeSetting, label }) => { - const theme = themeSetting === AppThemeSystemSetting.System ? currentTheme : themeSetting; + const theme = + themeSetting === AppThemeSystemSetting.System + ? globalThis.matchMedia('(prefers-color-scheme: dark)').matches + ? AppTheme.Dark + : AppTheme.Light + : themeSetting; const backgroundColor = Themes[theme][currentColorMode].layer2; const gridColor = Themes[theme][currentColorMode].borderDefault;