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

Unified Diff: ui/views/controls/button/text_button.cc

Issue 14322007: Add line height setting to views::Label & use it for notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months 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
Index: ui/views/controls/button/text_button.cc
diff --git a/ui/views/controls/button/text_button.cc b/ui/views/controls/button/text_button.cc
index dd4d1506a69566c09b65547a1def3f4a9d3c010c..5382703ea2ee27fd7b0d345896068bc1eac26b0b 100644
--- a/ui/views/controls/button/text_button.cc
+++ b/ui/views/controls/button/text_button.cc
@@ -376,7 +376,7 @@ void TextButtonBase::CalculateTextSize(gfx::Size* text_size, int max_width) {
if (!multi_line_)
flags |= gfx::Canvas::NO_ELLIPSIS;
- gfx::Canvas::SizeStringInt(text_, font_, &w, &h, flags);
+ gfx::Canvas::SizeStringInt(text_, font_, &w, &h, -1, flags);
text_size->SetSize(w, h);
}
@@ -498,6 +498,7 @@ void TextButtonBase::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
shadows.push_back(gfx::ShadowValue(text_shadow_offset_, 0, color));
}
canvas->DrawStringWithShadows(text_, font_, text_color, text_bounds,
+ -1, // Default line height.
msw 2013/04/17 20:12:59 nit: skip the -1 comment, the function decl commen
dharcourt 2013/04/17 23:29:40 Done.
draw_string_flags, shadows);
}
}

Powered by Google App Engine
This is Rietveld 408576698