mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Fix ultramarine flash when closing Settings window
This commit is contained in:
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
|
||||
|
||||
Reference in New Issue
Block a user