From f9c9ec4df96f748de8d8c4c05fa73d3af3bf8082 Mon Sep 17 00:00:00 2001 From: William Grant Date: Mon, 17 Oct 2022 17:08:41 +1100 Subject: [PATCH] fix: replace black grounds with classic dark background by default --- stylesheets/_global.scss | 4 ++-- ts/mains/main_node.ts | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/stylesheets/_global.scss b/stylesheets/_global.scss index 3dc56d7df..d77a6aa3b 100644 --- a/stylesheets/_global.scss +++ b/stylesheets/_global.scss @@ -5,7 +5,7 @@ html { height: 100%; // Default theme is Classic Dark - background-color: black; + background-color: #1b1b1b; } body { @@ -86,7 +86,7 @@ a { align-items: center; user-select: none; // Default theme is Classic Dark so we force this for the password prompt - background-color: black; + background-color: #1b1b1b; .content { margin-inline-start: auto; diff --git a/ts/mains/main_node.ts b/ts/mains/main_node.ts index 0741639f8..a8929e289 100644 --- a/ts/mains/main_node.ts +++ b/ts/mains/main_node.ts @@ -157,6 +157,7 @@ if (windowFromUserConfig) { import { load as loadLocale, LocaleMessagesWithNameType } from '../node/locale'; import { setLastestRelease } from '../node/latest_desktop_release'; import { getAppRootPath } from '../node/getRootPath'; +import { classicDark } from '../themes'; // Both of these will be set after app fires the 'ready' event let logger: Logger | null = null; @@ -282,7 +283,8 @@ async function createWindow() { minWidth, minHeight, fullscreen: false as boolean | undefined, - backgroundColor: '#000', + // Default theme is Classic Dark + backgroundColor: classicDark['--background-primary-color'], webPreferences: { nodeIntegration: true, enableRemoteModule: true, @@ -530,6 +532,8 @@ async function showPasswordWindow() { minWidth, minHeight, autoHideMenuBar: false, + // Default theme is Classic Dark + backgroundColor: classicDark['--background-primary-color'], webPreferences: { nodeIntegration: true, enableRemoteModule: true, @@ -604,7 +608,7 @@ async function showAbout() { resizable: true, title: locale.messages.about, autoHideMenuBar: true, - backgroundColor: '#000', + backgroundColor: classicDark['--background-primary-color'], show: false, webPreferences: { nodeIntegration: true, @@ -627,7 +631,7 @@ async function showAbout() { }); aboutWindow.once('ready-to-show', () => { - aboutWindow?.setBackgroundColor('#000'); + aboutWindow?.setBackgroundColor(classicDark['--background-primary-color']); }); // looks like sometimes ready-to-show is not fired by electron. @@ -657,7 +661,7 @@ async function showDebugLogWindow() { resizable: true, title: locale.messages.debugLog, autoHideMenuBar: true, - backgroundColor: '#000', + backgroundColor: classicDark['--background-primary-color'], shadow: true, show: false, modal: true, @@ -682,7 +686,7 @@ async function showDebugLogWindow() { }); debugLogWindow.once('ready-to-show', () => { - debugLogWindow?.setBackgroundColor('#000'); + debugLogWindow?.setBackgroundColor(classicDark['--background-primary-color']); }); // see above: looks like sometimes ready-to-show is not fired by electron