Commit ed43eedc authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Add space when omnibox suggestion has tab match

This CL makes sure that the omnibox suggestions labels width is taking
into account the presence of the "switch to open tab" button.

Bug: 908874
Change-Id: I92ce30dabadc511a319b43879baa125fa080e0f8
Reviewed-on: https://chromium-review.googlesource.com/c/1353940
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612209}
parent 8dc465d0
......@@ -417,12 +417,13 @@ UIColor* BackgroundColorIncognito() {
// Show append button for search history/search suggestions as the right
// control element (aka an accessory element of a table view cell).
row.trailingButton.hidden = !match.isAppendable && !match.isTabMatch;
BOOL hasVisibleTrailingButton = match.isAppendable || match.isTabMatch;
row.trailingButton.hidden = !hasVisibleTrailingButton;
[row.trailingButton cancelTrackingWithEvent:nil];
// If a right accessory element is present or the text alignment is right
// aligned, adjust the width to align with the accessory element.
if (match.isAppendable || alignmentRight) {
if (hasVisibleTrailingButton || alignmentRight) {
LayoutRect layout =
LayoutRectForRectInBoundingRect(textLabel.frame, self.view.frame);
layout.size.width -= kTrailingButtonWidth;
......
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