Fix ultramarine flash when closing Settings window
This commit is contained in:
parent
1a87989f94
commit
c4f0db0307
1 changed files with 13 additions and 5 deletions
18
app/main.ts
18
app/main.ts
|
@ -365,13 +365,18 @@ async function getResolvedThemeSetting(
|
|||
return ThemeType[theme];
|
||||
}
|
||||
|
||||
type GetBackgroundColorOptionsType = GetThemeSettingOptionsType &
|
||||
Readonly<{
|
||||
signalColors?: boolean;
|
||||
}>;
|
||||
|
||||
async function getBackgroundColor(
|
||||
options?: GetThemeSettingOptionsType
|
||||
options?: GetBackgroundColorOptionsType
|
||||
): Promise<string> {
|
||||
const theme = await getResolvedThemeSetting(options);
|
||||
|
||||
if (theme === 'light') {
|
||||
return '#3a76f0';
|
||||
return options?.signalColors ? '#3a76f0' : '#ffffff';
|
||||
}
|
||||
|
||||
if (theme === 'dark') {
|
||||
|
@ -695,7 +700,7 @@ async function createWindow() {
|
|||
titleBarStyle: mainTitleBarStyle,
|
||||
backgroundColor: isTestEnvironment(getEnvironment())
|
||||
? '#ffffff' // Tests should always be rendered on a white background
|
||||
: await getBackgroundColor(),
|
||||
: await getBackgroundColor({ signalColors: true }),
|
||||
webPreferences: {
|
||||
...defaultWebPrefs,
|
||||
nodeIntegration: false,
|
||||
|
@ -1347,7 +1352,7 @@ async function showAbout() {
|
|||
title: getResolvedMessagesLocale().i18n('icu:aboutSignalDesktop'),
|
||||
titleBarStyle: nonMainTitleBarStyle,
|
||||
autoHideMenuBar: true,
|
||||
backgroundColor: await getBackgroundColor(),
|
||||
backgroundColor: await getBackgroundColor({ signalColors: true }),
|
||||
show: false,
|
||||
webPreferences: {
|
||||
...defaultWebPrefs,
|
||||
|
@ -2142,7 +2147,10 @@ app.on('ready', async () => {
|
|||
// This color is to be used only in loading screen and in this case we should
|
||||
// never wait for the database to be initialized. Thus the theme setting
|
||||
// lookup should be done only in ephemeral config.
|
||||
const backgroundColor = await getBackgroundColor({ ephemeralOnly: true });
|
||||
const backgroundColor = await getBackgroundColor({
|
||||
ephemeralOnly: true,
|
||||
signalColors: true,
|
||||
});
|
||||
|
||||
drop(
|
||||
// eslint-disable-next-line more/no-then
|
||||
|
|
Loading…
Add table
Reference in a new issue