mirror of
https://github.com/heyman/heynote.git
synced 2024-11-21 23:43:22 +01:00
Save selected theme in config
This commit is contained in:
parent
9d729b6055
commit
a106159a9a
@ -24,7 +24,9 @@ const schema = {
|
||||
"showLineNumberGutter": {type: "boolean", default:true},
|
||||
"showFoldGutter": {type: "boolean", default:true},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
theme: {type: "string", default: "system"},
|
||||
}
|
||||
|
||||
const defaults = {
|
||||
@ -33,7 +35,8 @@ const defaults = {
|
||||
emacsMetaKey: "meta",
|
||||
showLineNumberGutter: true,
|
||||
showFoldGutter: true,
|
||||
}
|
||||
},
|
||||
theme: "system",
|
||||
}
|
||||
|
||||
export default new Store({schema, defaults})
|
||||
|
@ -109,7 +109,7 @@ async function createWindow() {
|
||||
}
|
||||
})
|
||||
|
||||
//nativeTheme.themeSource = "light"
|
||||
nativeTheme.themeSource = CONFIG.get("theme")
|
||||
|
||||
if (process.env.VITE_DEV_SERVER_URL) { // electron-vite-vue#298
|
||||
win.loadURL(url + '?dev=1')
|
||||
@ -166,6 +166,7 @@ app.on('activate', () => {
|
||||
})
|
||||
|
||||
ipcMain.handle('dark-mode:set', (event, mode) => {
|
||||
CONFIG.set("theme", mode)
|
||||
nativeTheme.themeSource = mode
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user