Skip to content

Commit

Permalink
[QT] Fix frame colors when using server-side-decorations
Browse files Browse the repository at this point in the history
When "Use system titlebar and borders" is enabled, the frame is drawn
differently.  This CL changes the reported frame colors to handle this
case.  This change doesn't affect frame rendering since QtUi draws
the frame itself, however this is important for computing colors based
on the frame color such as the tab stroke color.

R=thestig

Change-Id: Ida0df5741e2d6e4539a0640200beb8959fa039cb
Bug: 1317782
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4114404
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1084589}
  • Loading branch information
tanderson-google authored and Chromium LUCI CQ committed Dec 16, 2022
1 parent 35d256d commit 1064b35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/qt/qt_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,12 @@ void QtUi::AddNativeColorMixer(ui::ColorProvider* provider,
for (const auto& map : kMaps)
mixer[map.id] = {shim_->GetColor(map.role, map.state)};

const bool use_custom_frame =
key.frame_type == ui::ColorProviderManager::FrameType::kChromium;
mixer[ui::kColorFrameActive] = {
shim_->GetFrameColor(ColorState::kNormal, true)};
shim_->GetFrameColor(ColorState::kNormal, use_custom_frame)};
mixer[ui::kColorFrameInactive] = {
shim_->GetFrameColor(ColorState::kInactive, true)};
shim_->GetFrameColor(ColorState::kInactive, use_custom_frame)};
}

DISABLE_CFI_VCALL
Expand Down

0 comments on commit 1064b35

Please sign in to comment.