Commit 5eecfde8 authored by Daniel Rubery's avatar Daniel Rubery Committed by Commit Bot

Fix widths of download shelf items

This CL fixes a regression that leads to inconsistent widths for the
items on the download shelf. This regression was introduced by
https://chromium-review.googlesource.com/c/chromium/src/+/1864876

Fixed: 1017101, 1017921
Change-Id: Id0365810848dcdac59edec49eae1197c02130d00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1887890Reviewed-by: default avatarShakti Sahu <shaktisahu@chromium.org>
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711056}
parent 6b19d3e4
...@@ -479,9 +479,8 @@ void DownloadItemView::Layout() { ...@@ -479,9 +479,8 @@ void DownloadItemView::Layout() {
int status_y = int status_y =
file_name_y + font_list_.GetBaseline() + kVerticalTextPadding; file_name_y + font_list_.GetBaseline() + kVerticalTextPadding;
status_label_->SetBoundsRect(gfx::Rect( status_label_->SetBoundsRect(gfx::Rect(mirrored_x, status_y, kTextWidth,
mirrored_x, status_y, status_label_->GetPreferredSize().width(), status_font_list_.GetHeight()));
status_font_list_.GetHeight()));
} }
if (mode_ != DANGEROUS_MODE) { if (mode_ != DANGEROUS_MODE) {
...@@ -533,7 +532,7 @@ gfx::Size DownloadItemView::CalculatePreferredSize() const { ...@@ -533,7 +532,7 @@ gfx::Size DownloadItemView::CalculatePreferredSize() const {
gfx::Size label_size = file_name_label_->GetPreferredSize(); gfx::Size label_size = file_name_label_->GetPreferredSize();
label_size.SetToMax(status_label_->GetPreferredSize()); label_size.SetToMax(status_label_->GetPreferredSize());
width = kStartPadding + DownloadShelf::kProgressIndicatorSize + width = kStartPadding + DownloadShelf::kProgressIndicatorSize +
kProgressTextPadding + label_size.width() + kEndPadding; kProgressTextPadding + kTextWidth + kEndPadding;
} }
if (mode_ != DANGEROUS_MODE) if (mode_ != DANGEROUS_MODE)
......
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