Chromium Code Reviews
DescriptionAdjust 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 #
Messages
Total messages: 8 (3 generated)
|
|||||||||||||||||||||||||||||||||||||