mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-26 19:38:48 +01:00
This commit is contained in:
parent
1c688288be
commit
30535ba6af
8 changed files with 67 additions and 81 deletions
|
|
@ -335,7 +335,12 @@ const boot = () => {
|
|||
}
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
nativeTheme.on('updated', () => {
|
||||
mainWindow.webContents.send('siyuan-update-theme', {
|
||||
theme: nativeTheme.shouldUseDarkColors ? 'dark' : 'light',
|
||||
init: false,
|
||||
})
|
||||
})
|
||||
// 监听主题切换
|
||||
ipcMain.on('siyuan-config-theme', (event, theme) => {
|
||||
nativeTheme.themeSource = theme
|
||||
|
|
@ -376,6 +381,10 @@ const boot = () => {
|
|||
writeLog('exited ui')
|
||||
})
|
||||
ipcMain.on('siyuan-init', async () => {
|
||||
mainWindow.webContents.send('siyuan-update-theme', {
|
||||
theme: nativeTheme.shouldUseDarkColors ? 'dark' : 'light',
|
||||
init: true,
|
||||
})
|
||||
await fetch('http://127.0.0.1:6806/api/system/uiproc?pid=' + process.pid,
|
||||
{method: 'POST'})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue