修复亮暗主题自动切换功能无效的问题(#1697)
This commit is contained in:
+6
-4
@@ -172,9 +172,11 @@ export const listenerAppEvent = (startApp: () => void) => {
|
||||
initScreenParams()
|
||||
})
|
||||
|
||||
nativeTheme.addListener('updated', (event: any) => {
|
||||
const themeInfo: Electron.NativeTheme = event.sender
|
||||
global.lx?.event_app.system_theme_change(themeInfo.shouldUseDarkColors)
|
||||
nativeTheme.addListener('updated', () => {
|
||||
const shouldUseDarkColors = nativeTheme.shouldUseDarkColors
|
||||
if (shouldUseDarkColors == global.lx.theme.shouldUseDarkColors) return
|
||||
global.lx.theme.shouldUseDarkColors = shouldUseDarkColors
|
||||
global.lx?.event_app.system_theme_change(shouldUseDarkColors)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -224,7 +226,7 @@ export const initAppSetting = async() => {
|
||||
state: new Map(),
|
||||
},
|
||||
theme: {
|
||||
shouldUseDarkColors: false,
|
||||
shouldUseDarkColors: nativeTheme.shouldUseDarkColors,
|
||||
theme: {
|
||||
id: '',
|
||||
name: '',
|
||||
|
||||
Reference in New Issue
Block a user