Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Issue 2070133004: Adjust omnibox and dropdown text position to be correct. (Closed)

Created:
4 years, 6 months ago by Peter Kasting
Modified:
4 years, 6 months ago
Reviewers:
Evan Stade
CC:
chromium-reviews, tfarina, James Su
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adjust omnibox and dropdown text position to be correct. There were a variety of issues here. It appears the textfield does not actually put 1 px before the edit text (verified using wide letters like 'w' and scrolling the field until they were clipped on the right). The RTL-only pre-MD code (which I wrote long ago) was incorrect too, AFAICT; it's just misleading because the edit reserves space for the cursor on the right side. (Maybe the textfield has changed since I wrote that, or it dated from the CRichEditCtrl days. I don't remember.) The trailing padding incorrectly subtracted the edge thickness. This wasn't previously visible on MD (see next paragraph), but on non-MD it brought the end of the text closer to the visible edge. But if we wanted that effect, we should have made the trailing padding e.g. "edge thickness + 1" instead of "item padding - edge thickness". With the larger item padding in MD this was that much weirder. Changing this left the same padding on the right side of the omnibox as everywhere else in the location bar. The trailing padding on MD was set to 0 for no obvious reason (this dates back about a year). This led to clipping the right edge on higher scale factors. Using the normal calculation fixed this. The dropdown icon width was calculated using the pre-MD raster icons even for MD. This was fixed to use the same size the location bar uses by means of a new oracle function on that class. This moved the dropdown text closer to the icon. BUG=616191 TEST=Type in the omnibox; the text in the dropdown should line up horizontally with the text in the omnibox. Committed: https://crrev.com/f08f7b065f97fcfd408743f2158ab08af49679ef Cr-Commit-Position: refs/heads/master@{#400049}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -25 lines) Patch
M chrome/browser/ui/views/location_bar/location_bar_view.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 5 chunks +14 lines, -19 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_result_view.cc View 1 chunk +2 lines, -6 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
Peter Kasting
The only question mark here is whether the edit places extra space before the text ...
4 years, 6 months ago (2016-06-15 22:22:09 UTC) #2
Evan Stade
this looks correct on gtk. lgtm
4 years, 6 months ago (2016-06-15 23:48:18 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2070133004/1
4 years, 6 months ago (2016-06-15 23:52:52 UTC) #5
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 6 months ago (2016-06-15 23:57:57 UTC) #6
commit-bot: I haz the power
4 years, 6 months ago (2016-06-16 00:00:34 UTC) #8
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/f08f7b065f97fcfd408743f2158ab08af49679ef
Cr-Commit-Position: refs/heads/master@{#400049}

Powered by Google App Engine
This is Rietveld 408576698