Skip to content

Commit

Permalink
[Merge 116] Update side panel content border for cr2023 and combobox …
Browse files Browse the repository at this point in the history
…icon color for pre-cr2023.

The side panel combobox icon color update fixes a bug introduced in
crrev.com/c/4615629

(cherry picked from commit a43c8b2)

Bug: 1399966, 1456631
Change-Id: I739ff91753153ca359e68e07ab167b2ef0a8027e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4633597
Reviewed-by: Thomas Lukaszewicz <tluk@chromium.org>
Commit-Queue: Caroline Rising <corising@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1160750}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4637605
Auto-Submit: Caroline Rising <corising@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/5845@{#47}
Cr-Branched-From: 5a5dff6-refs/heads/main@{#1160321}
  • Loading branch information
Caroline Rising authored and Chromium LUCI CQ committed Jun 23, 2023
1 parent 9ad7893 commit 685254c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions chrome/browser/ui/color/chrome_color_mixer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ void AddChromeColorMixer(ui::ColorProvider* provider,
mixer[kColorShareThisTabSourceViewBorder] = {ui::kColorMidground};
mixer[kColorSidePanelBackground] = {kColorToolbar};
mixer[kColorSidePanelContentAreaSeparator] = {ui::kColorSeparator};
mixer[kColorSidePanelEntryIcon] = {ui::kColorIcon};
mixer[kColorSidePanelHeaderButtonIcon] = {ui::kColorIcon};
mixer[kColorSidePanelHeaderButtonIconDisabled] = {ui::kColorIconDisabled};
mixer[kColorSidePanelResizeAreaHandle] = {kColorToolbarContentAreaSeparator};
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/ui/color/material_side_panel_color_mixer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ void AddMaterialSidePanelColorMixer(ui::ColorProvider* provider,
mixer[kColorSidePanelContentBackground] = {ui::kColorSysBaseContainer};
mixer[kColorSidePanelEntryIcon] = {ui::kColorSysPrimary};
mixer[kColorSidePanelEntryTitle] = {ui::kColorSysOnSurface};
mixer[kColorSidePanelContentAreaSeparator] = {ui::kColorSysBaseContainer};

// After ChromeRefresh2023 roll out these three should be moved to replace
// their colors in c/b/ui/color/chrome_color_mixer.cc. For now they need a
Expand Down
30 changes: 14 additions & 16 deletions chrome/browser/ui/views/side_panel/side_panel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,20 @@ class SidePanelBorder : public views::Border {
/*translate_view_coordinates=*/true);
}

if (!features::IsChromeRefresh2023()) {
// Paint the inner border around SidePanel content.
const float stroke_thickness = views::Separator::kThickness * dsf;

cc::PaintFlags flags;
flags.setStrokeWidth(stroke_thickness);
flags.setColor(view.GetColorProvider()->GetColor(
kColorSidePanelContentAreaSeparator));
flags.setStyle(cc::PaintFlags::kStroke_Style);
flags.setAntiAlias(true);

// Outset half of the stroke thickness so that it's painted fully on the
// outside of the clipping region.
clip_bounds.Inset(gfx::Insets(-stroke_thickness / 2));
canvas->DrawRoundRect(clip_bounds, corner_radius, flags);
}
// Paint the inner border around SidePanel content.
const float stroke_thickness = views::Separator::kThickness * dsf;

cc::PaintFlags flags;
flags.setStrokeWidth(stroke_thickness);
flags.setColor(
view.GetColorProvider()->GetColor(kColorSidePanelContentAreaSeparator));
flags.setStyle(cc::PaintFlags::kStroke_Style);
flags.setAntiAlias(true);

// Outset half of the stroke thickness so that it's painted fully on the
// outside of the clipping region.
clip_bounds.Inset(gfx::Insets(-stroke_thickness / 2));
canvas->DrawRoundRect(clip_bounds, corner_radius, flags);
}

gfx::Insets GetInsets() const override {
Expand Down

0 comments on commit 685254c

Please sign in to comment.