fix: undefined backgroundColor (#32517)
This commit is contained in:
parent
b89361a991
commit
df50a0efb1
1 changed files with 4 additions and 3 deletions
|
@ -37,7 +37,6 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
|
||||||
gin::Dictionary::CreateEmpty(isolate);
|
gin::Dictionary::CreateEmpty(isolate);
|
||||||
options.Get(options::kWebPreferences, &web_preferences);
|
options.Get(options::kWebPreferences, &web_preferences);
|
||||||
|
|
||||||
v8::Local<v8::Value> value;
|
|
||||||
bool transparent = false;
|
bool transparent = false;
|
||||||
options.Get(options::kTransparent, &transparent);
|
options.Get(options::kTransparent, &transparent);
|
||||||
|
|
||||||
|
@ -47,8 +46,9 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Copy the backgroundColor to webContents.
|
// Copy the backgroundColor to webContents.
|
||||||
if (options.Get(options::kBackgroundColor, &value)) {
|
std::string color;
|
||||||
web_preferences.SetHidden(options::kBackgroundColor, value);
|
if (options.Get(options::kBackgroundColor, &color)) {
|
||||||
|
web_preferences.SetHidden(options::kBackgroundColor, color);
|
||||||
} else if (!vibrancy_type.empty() || transparent) {
|
} else if (!vibrancy_type.empty() || transparent) {
|
||||||
// If the BrowserWindow is transparent or a vibrancy type has been set,
|
// If the BrowserWindow is transparent or a vibrancy type has been set,
|
||||||
// also propagate transparency to the WebContents unless a separate
|
// also propagate transparency to the WebContents unless a separate
|
||||||
|
@ -79,6 +79,7 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy the webContents option to webPreferences.
|
// Copy the webContents option to webPreferences.
|
||||||
|
v8::Local<v8::Value> value;
|
||||||
if (options.Get("webContents", &value)) {
|
if (options.Get("webContents", &value)) {
|
||||||
web_preferences.SetHidden("webContents", value);
|
web_preferences.SetHidden("webContents", value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue