| Index: ui/views/controls/label.cc
|
| diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
|
| index f2d891d4e17ea5c329b77ce0e71d087107ccd48e..e88573fc3d585aa33778c62f7e0715c3fc6b1276 100644
|
| --- a/ui/views/controls/label.cc
|
| +++ b/ui/views/controls/label.cc
|
| @@ -48,12 +48,15 @@ Label::Label(const base::string16& text)
|
|
|
| Label::Label(const base::string16& text, int text_context, int text_style)
|
| : context_menu_contents_(this) {
|
| - Init(text, style::GetFont(text_context, text_style));
|
| + Init(text);
|
| + render_text_->SetFontList(style::GetFont(text_context, text_style));
|
| + SetLineHeight(style::GetLineHeight(text_context, text_style));
|
| }
|
|
|
| Label::Label(const base::string16& text, const CustomFont& font)
|
| : context_menu_contents_(this) {
|
| - Init(text, font.font_list);
|
| + Init(text);
|
| + render_text_->SetFontList(font.font_list);
|
| }
|
|
|
| Label::~Label() {
|
| @@ -794,14 +797,13 @@ const gfx::RenderText* Label::GetRenderTextForSelectionController() const {
|
| return lines_[0].get();
|
| }
|
|
|
| -void Label::Init(const base::string16& text, const gfx::FontList& font_list) {
|
| +void Label::Init(const base::string16& text) {
|
| render_text_.reset(gfx::RenderText::CreateInstance());
|
| render_text_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
|
| render_text_->SetDirectionalityMode(gfx::DIRECTIONALITY_FROM_TEXT);
|
| // NOTE: |render_text_| should not be elided at all. This is used to keep some
|
| // properties and to compute the size of the string.
|
| render_text_->SetElideBehavior(gfx::NO_ELIDE);
|
| - render_text_->SetFontList(font_list);
|
| render_text_->SetCursorEnabled(false);
|
| render_text_->SetWordWrapBehavior(gfx::TRUNCATE_LONG_WORDS);
|
|
|
|
|