Commit 17460753 authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Commit Bot

Add maximum width for labels in feature pods

Bug: 1057952
Change-Id: Ie8b3684340609c5bcde1b54a51c110fe8a5f74b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128834Reviewed-by: default avatarTim Song <tengs@chromium.org>
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754734}
parent 7baac1a8
...@@ -331,7 +331,8 @@ void FeaturePodLabelButton::OnEnabledChanged() { ...@@ -331,7 +331,8 @@ void FeaturePodLabelButton::OnEnabledChanged() {
void FeaturePodLabelButton::LayoutInCenter(views::View* child, int y) { void FeaturePodLabelButton::LayoutInCenter(views::View* child, int y) {
gfx::Rect contents_bounds = GetContentsBounds(); gfx::Rect contents_bounds = GetContentsBounds();
gfx::Size preferred_size = child->GetPreferredSize(); gfx::Size preferred_size = child->GetPreferredSize();
int child_width = preferred_size.width(); int child_width =
std::min(kUnifiedFeaturePodLabelWidth, preferred_size.width());
child->SetBounds( child->SetBounds(
contents_bounds.x() + (contents_bounds.width() - child_width) / 2, y, contents_bounds.x() + (contents_bounds.width() - child_width) / 2, y,
child_width, preferred_size.height()); child_width, preferred_size.height());
......
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