Commit 4f0592d4 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Revert "Shrink drop-down button in DownloadItemView"

This reverts commit e533973d.

Reason for revert: Caused regression in LTR.

This issue should be fixed by rewriting DownloadItemView to not do
manual layout.

Bug: chromium:1045314

Original change's description:
> Shrink drop-down button in DownloadItemView
> 
> This more closely matches the button size for the close-x at the end of
> the downloads shelf. The focus ring and ink-drop highlight was
> significantly larger than intended, likely after r619533.
> 
> This change also adds padding left of the drop-down button so that the
> "Discard" button doesn't get laid out edge-to-edge next to it with
> overlapping focus rings.
> 
> Bug: chromium:1042633
> Change-Id: I3aac0b77846020e0fe3eb612d35f67bf307dbd6d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2006136
> Auto-Submit: Peter Boström <pbos@chromium.org>
> Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
> Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#732821}

TBR=ellyjones@chromium.org,pbos@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:1042633
Change-Id: Ie9de1a823eab8dbf1d67ab0573e4801fc60c119c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2019467Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735008}
parent a501ecb6
...@@ -254,7 +254,7 @@ DownloadItemView::DownloadItemView(DownloadUIModel::DownloadUIModelPtr download, ...@@ -254,7 +254,7 @@ DownloadItemView::DownloadItemView(DownloadUIModel::DownloadUIModelPtr download,
dropdown_button->SetAccessibleName(l10n_util::GetStringUTF16( dropdown_button->SetAccessibleName(l10n_util::GetStringUTF16(
IDS_DOWNLOAD_ITEM_DROPDOWN_BUTTON_ACCESSIBLE_TEXT)); IDS_DOWNLOAD_ITEM_DROPDOWN_BUTTON_ACCESSIBLE_TEXT));
dropdown_button->SetBorder(views::CreateEmptyBorder(gfx::Insets(4))); dropdown_button->SetBorder(views::CreateEmptyBorder(gfx::Insets(10)));
dropdown_button->set_has_ink_drop_action_on_click(false); dropdown_button->set_has_ink_drop_action_on_click(false);
dropdown_button->SetFocusForPlatform(); dropdown_button->SetFocusForPlatform();
dropdown_button_ = AddChildView(std::move(dropdown_button)); dropdown_button_ = AddChildView(std::move(dropdown_button));
...@@ -576,10 +576,8 @@ gfx::Size DownloadItemView::CalculatePreferredSize() const { ...@@ -576,10 +576,8 @@ gfx::Size DownloadItemView::CalculatePreferredSize() const {
kProgressTextPadding + kTextWidth + kEndPadding; kProgressTextPadding + kTextWidth + kEndPadding;
} }
if (mode_ != DANGEROUS_MODE) { if (mode_ != DANGEROUS_MODE)
// Add an extra kEndPadding as padding before |dropdown_button_|. width += dropdown_button_->GetPreferredSize().width();
width += dropdown_button_->GetPreferredSize().width() + kEndPadding;
}
return gfx::Size(width, std::max(kDefaultDownloadItemHeight, return gfx::Size(width, std::max(kDefaultDownloadItemHeight,
2 * kMinimumVerticalPadding + child_height)); 2 * kMinimumVerticalPadding + child_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