From a80d22740045a61fd14fd5da401c0d123d54f4de Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Fri, 24 Jun 2022 18:17:37 +0200 Subject: [PATCH] fix(Windows): white window buttons with dark theme --- src/main/main.ts | 2 +- src/renderer/App.vue | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/main.ts b/src/main/main.ts index d4b29b25..d59eae33 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -86,7 +86,7 @@ else { ipcMain.on('refresh-theme-settings', () => { const appTheme = persistentStore.get('application_theme'); - if (isWindows) { + if (isWindows && mainWindow) { mainWindow.setTitleBarOverlay({ color: appTheme === 'dark' ? '#3f3f3f' : '#fff', symbolColor: appTheme === 'dark' ? '#fff' : '#000' diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 86846d79..93248659 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -64,12 +64,20 @@ export default { const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore); const { checkVersionUpdate } = applicationStore; + const { changeApplicationTheme } = settingsStore; + + document.addEventListener('DOMContentLoaded', () => { + setTimeout(() => { + changeApplicationTheme(applicationTheme.value);// Forces persistentStore to save on file and mail process + }, 1000); + }); return { isLoading, isSettingModal, isScratchpad, checkVersionUpdate, + changeApplicationTheme, connections, applicationTheme, disableBlur,