Commit 69ee66f3 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Fix background for leading/trailing ToolbarButtons

This accounts for additional internal padding which is present for
leading/trailing buttons when maximized / in fullscreen.

Bug: None
Change-Id: If6841101172316174d2bce5b6091d2f31e9f197b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1903652
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Caroline Rising <corising@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: default avatarCaroline Rising <corising@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713493}
parent 448ec6f6
...@@ -144,8 +144,9 @@ void ToolbarButton::UpdateColorsAndInsets() { ...@@ -144,8 +144,9 @@ void ToolbarButton::UpdateColorsAndInsets() {
highlight_color_animation_.GetBackgroundColor(); highlight_color_animation_.GetBackgroundColor();
if (background_color) { if (background_color) {
// ToolbarButtons are always the height the location bar. // ToolbarButtons are always the height the location bar.
const gfx::Insets bg_insets( const gfx::Insets bg_insets =
(height() - GetLayoutConstant(LOCATION_BAR_HEIGHT)) / 2); gfx::Insets((height() - GetLayoutConstant(LOCATION_BAR_HEIGHT)) / 2) +
*GetProperty(views::kInternalPaddingKey);
SetBackground(views::CreateBackgroundFromPainter( SetBackground(views::CreateBackgroundFromPainter(
views::Painter::CreateSolidRoundRectPainter( views::Painter::CreateSolidRoundRectPainter(
*background_color, highlight_radius, bg_insets))); *background_color, highlight_radius, bg_insets)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment