Commit 962dfaec authored by Jan Krcal's avatar Jan Krcal Committed by Chromium LUCI CQ

[Profile menu] Fix long name overflowing the layout

This CL sets the right flex specifications so that the heading label
does not overflow the size of its parent.

Before: https://screenshot.googleplex.com/XowRbDCxFuxxnwZ
After: https://screenshot.googleplex.com/7KL7g5SN3dX2ZEy

Bug: 1166687
Change-Id: I072a651e838ed46df0cc4584638930911224de7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628957Reviewed-by: default avatarAlex Ilin <alexilin@chromium.org>
Commit-Queue: Jan Krcal <jkrcal@chromium.org>
Auto-Submit: Jan Krcal <jkrcal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843630}
parent f48f920d
......@@ -415,7 +415,7 @@ void BuildProfileBackgroundContainer(
std::make_unique<views::View>());
heading_and_image_container->SetProperty(
views::kFlexBehaviorKey,
views::FlexSpecification(views::MinimumFlexSizeRule::kPreferred,
views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToZero,
views::MaximumFlexSizeRule::kUnbounded)
.WithOrder(1));
heading_and_image_container
......@@ -628,6 +628,10 @@ void ProfileMenuViewBase::SetProfileIdentityInfo(
heading_label = std::make_unique<views::Label>(profile_name, font);
heading_label->SetElideBehavior(gfx::ELIDE_TAIL);
heading_label->SetHorizontalAlignment(gfx::ALIGN_CENTER);
heading_label->SetProperty(
views::kFlexBehaviorKey,
views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToZero,
views::MaximumFlexSizeRule::kUnbounded));
if (background_color) {
heading_label->SetAutoColorReadabilityEnabled(false);
heading_label->SetEnabledColor(
......
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