Skip to content

Commit

Permalink
fix: Set background for WCO container (#35612)
Browse files Browse the repository at this point in the history
* fix: Set background for WCO container

* Add background when invalidating as well

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
  • Loading branch information
trop[bot] and rzhao271 committed Sep 8, 2022
1 parent 62b64e6 commit 686a554
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shell/browser/ui/views/win_caption_button_container.cc
Expand Up @@ -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"

Expand Down Expand Up @@ -128,6 +129,8 @@ void WinCaptionButtonContainer::AddedToWidget() {
UpdateButtons();

if (frame_view_->window()->IsWindowControlsOverlayEnabled()) {
SetBackground(views::CreateSolidBackground(
frame_view_->window()->overlay_button_color()));
SetPaintToLayer();
}
}
Expand Down
3 changes: 3 additions & 0 deletions shell/browser/ui/views/win_frame_view.cc
Expand Up @@ -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"

Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 686a554

Please sign in to comment.