Commit 0c73f82b authored by Dave Schuyler's avatar Dave Schuyler Committed by Commit Bot

[Omnibox] update separator width when calculating max widths

This CL updates the size of the separator text when laying out a split
row using ComputeMaxWidths.

Bug: 839714
Change-Id: I4350f864115bd891a00f3fb8a34a2a2eafe67e17
Reviewed-on: https://chromium-review.googlesource.com/1049106
Commit-Queue: Dave Schuyler <dschuyler@chromium.org>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556893}
parent b4428e58
...@@ -285,14 +285,15 @@ void OmniboxMatchCellView::LayoutSplit() { ...@@ -285,14 +285,15 @@ void OmniboxMatchCellView::LayoutSplit() {
x += icon_view_->width() + HorizontalPadding(); x += icon_view_->width() + HorizontalPadding();
int content_width = content_view_->CalculatePreferredSize().width(); int content_width = content_view_->CalculatePreferredSize().width();
int description_width = description_view_->CalculatePreferredSize().width(); int description_width = description_view_->CalculatePreferredSize().width();
gfx::Size separator_size = separator_view_->CalculatePreferredSize();
OmniboxPopupModel::ComputeMatchMaxWidths( OmniboxPopupModel::ComputeMatchMaxWidths(
content_width, separator_view_->width(), description_width, width() - x, content_width, separator_size.width(), description_width, width() - x,
/*description_on_separate_line=*/false, !is_search_type_, &content_width, /*description_on_separate_line=*/false, !is_search_type_, &content_width,
&description_width); &description_width);
content_view_->SetBounds(x, y, content_width, text_height_); content_view_->SetBounds(x, y, content_width, text_height_);
if (description_width != 0) { if (description_width != 0) {
x += content_view_->width(); x += content_view_->width();
separator_view_->SetSize(separator_view_->CalculatePreferredSize()); separator_view_->SetSize(separator_size);
separator_view_->SetBounds(x, y, separator_view_->width(), text_height_); separator_view_->SetBounds(x, y, separator_view_->width(), text_height_);
x += separator_view_->width(); x += separator_view_->width();
description_view_->SetBounds(x, y, description_width, text_height_); description_view_->SetBounds(x, y, description_width, text_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