fix: Set background for WCO container (#35569)

* fix: Set background for WCO container

* Add background when invalidating as well
This commit is contained in:
Raymond Zhao 2022-09-08 06:11:51 -07:00 committed by GitHub
parent 17d5016163
commit 4fb4167b8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -14,6 +14,7 @@
#include "shell/browser/ui/views/win_frame_view.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/background.h"
#include "ui/views/layout/flex_layout.h"
#include "ui/views/view_class_properties.h"
@ -128,6 +129,8 @@ void WinCaptionButtonContainer::AddedToWidget() {
UpdateButtons();
if (frame_view_->window()->IsWindowControlsOverlayEnabled()) {
SetBackground(views::CreateSolidBackground(
frame_view_->window()->overlay_button_color()));
SetPaintToLayer();
}
}

View file

@ -19,6 +19,7 @@
#include "ui/display/win/dpi.h"
#include "ui/display/win/screen_win.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/views/background.h"
#include "ui/views/widget/widget.h"
#include "ui/views/win/hwnd_util.h"
@ -58,6 +59,8 @@ void WinFrameView::InvalidateCaptionButtons() {
if (!caption_button_container_)
return;
caption_button_container_->SetBackground(
views::CreateSolidBackground(window()->overlay_button_color()));
caption_button_container_->InvalidateLayout();
caption_button_container_->SchedulePaint();
}