Commit eae95972 authored by chinsenj's avatar chinsenj Committed by Commit Bot

cros: Fix desks rename textfield elision.

Currently the desk rename textfield does not account for its padding
when eliding its text. This results in the first couple of letters not
being visible when a long desk name is typed.

This CL fixes this bug by making the desk rename textfield account for
its padding.

Test: manual
Bug: 1142104
Change-Id: I515e9822bd8d1321d62bb976bdfa59ad5fcb48ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505678Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Jeremy Chinsen <chinsenj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822712}
parent f0a0e0e5
......@@ -73,8 +73,7 @@ void DeskNameView::CommitChanges(views::Widget* widget) {
}
void DeskNameView::SetTextAndElideIfNeeded(const base::string16& text) {
SetText(gfx::ElideText(text, GetFontList(),
parent()->GetPreferredSize().width(),
SetText(gfx::ElideText(text, GetFontList(), GetContentsBounds().width(),
gfx::ELIDE_TAIL));
full_text_ = text;
}
......
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