fix: frameless mica/acrylic windows (#39708)
* fix: backgroundMaterial works with frameless * TODO: fix frameless mica/acrylic windows * update caption color appropriately * set background color properly * refactor translucency method * actualization
This commit is contained in:
parent
ab185c058f
commit
d182794179
7 changed files with 96 additions and 21 deletions
|
@ -42,19 +42,11 @@ BrowserWindow::BrowserWindow(gin::Arguments* args,
|
|||
auto web_preferences = gin_helper::Dictionary::CreateEmpty(isolate);
|
||||
options.Get(options::kWebPreferences, &web_preferences);
|
||||
|
||||
bool transparent = false;
|
||||
options.Get(options::kTransparent, &transparent);
|
||||
|
||||
std::string vibrancy_type;
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
options.Get(options::kVibrancyType, &vibrancy_type);
|
||||
#endif
|
||||
|
||||
// Copy the backgroundColor to webContents.
|
||||
std::string color;
|
||||
if (options.Get(options::kBackgroundColor, &color)) {
|
||||
web_preferences.SetHidden(options::kBackgroundColor, color);
|
||||
} else if (!vibrancy_type.empty() || transparent) {
|
||||
} else if (window_->IsTranslucent()) {
|
||||
// If the BrowserWindow is transparent or a vibrancy type has been set,
|
||||
// also propagate transparency to the WebContents unless a separate
|
||||
// backgroundColor has been set.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue