Use BrowserWindow's backgroundColor as renderer view's background color

This commit is contained in:
Cheng Zhao 2016-04-02 20:35:57 +09:00
commit cb470cb94b
12 changed files with 88 additions and 36 deletions

View file

@ -141,6 +141,10 @@ Window::Window(v8::Isolate* isolate, const mate::Dictionary& options) {
if (options.Get(options::kZoomFactor, &value))
web_preferences.Set(options::kZoomFactor, value);
// Copy the backgroundColor to webContents.
if (options.Get(options::kBackgroundColor, &value))
web_preferences.Set(options::kBackgroundColor, value);
// Creates the WebContents used by BrowserWindow.
auto web_contents = WebContents::Create(isolate, web_preferences);
web_contents_.Reset(isolate, web_contents.ToV8());