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

Unified Diff: views/controls/label.cc

Issue 4233003: Not all text-sizing calls took the insets into account, leading to inconsiste... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/label.cc
===================================================================
--- views/controls/label.cc (revision 64470)
+++ views/controls/label.cc (working copy)
@@ -184,7 +184,8 @@
}
// Show the full text if the text does not fit.
- if (!is_multi_line_ && font_.GetStringWidth(text_) > width()) {
+ if (!is_multi_line_ &&
+ (font_.GetStringWidth(text_) > GetAvailableRect().width())) {
*tooltip = text_;
return true;
}
@@ -423,8 +424,8 @@
if (url_set_) {
// TODO(jungshik) : Figure out how to get 'intl.accept_languages'
// preference and use it when calling ElideUrl.
- *paint_text = UTF16ToWideHack(gfx::ElideUrl(url_, font_, width(),
- std::wstring()));
+ *paint_text = UTF16ToWideHack(
+ gfx::ElideUrl(url_, font_, GetAvailableRect().width(), std::wstring()));
// An URLs is always treated as an LTR text and therefore we should
// explicitly mark it as such if the locale is RTL so that URLs containing
@@ -439,7 +440,7 @@
WideToUTF16(*paint_text)));
} else if (elide_in_middle_) {
*paint_text = UTF16ToWideHack(gfx::ElideText(WideToUTF16Hack(text_),
- font_, width(), true));
+ font_, GetAvailableRect().width(), true));
} else {
*paint_text = text_;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698