Commit 0c35924f authored by Connie Wan's avatar Connie Wan Committed by Commit Bot

Ensure group header height is always positive

Use the tab height constant instead of the height of the view. The former should match the desired height anyway, since group headers are TabSlotViews. The latter can sometimes be 0, e.g. when dragging a group header into a new window.

Bug: 1005333
Change-Id: I6000af475cb25f0635fbacc1f0ef8acd6aa9fe67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1906329Reviewed-by: default avatarCharlene Yan <cyan@chromium.org>
Reviewed-by: default avatarTaylor Bergquist <tbergquist@chromium.org>
Commit-Queue: Connie Wan <connily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714526}
parent 8f349297
......@@ -155,7 +155,7 @@ void TabGroupHeader::VisualsChanged() {
title_->SetVisible(false);
constexpr int kEmptyChipSize = 14;
const int y = (height() - kEmptyChipSize) / 2;
const int y = (GetLayoutConstant(TAB_HEIGHT) - kEmptyChipSize) / 2;
title_chip_->SetBounds(TabGroupUnderline::GetStrokeInset(), y,
kEmptyChipSize, kEmptyChipSize);
......@@ -184,7 +184,8 @@ void TabGroupHeader::VisualsChanged() {
const int text_vertical_inset = 1;
const int text_horizontal_inset = corner_radius + text_vertical_inset;
const int y = (height() - text_height) / 2 - text_vertical_inset;
const int y =
(GetLayoutConstant(TAB_HEIGHT) - text_height) / 2 - text_vertical_inset;
title_chip_->SetBounds(TabGroupUnderline::GetStrokeInset(), y,
text_width + 2 * text_horizontal_inset,
......
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