| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/controls/styled_label.h" | 5 #include "ui/views/controls/styled_label.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 result->SetEnabledColor(style_info.color); | 50 result->SetEnabledColor(style_info.color); |
| 51 result->SetFontList(font_list); | 51 result->SetFontList(font_list); |
| 52 | 52 |
| 53 if (!style_info.tooltip.empty()) | 53 if (!style_info.tooltip.empty()) |
| 54 result->SetTooltipText(style_info.tooltip); | 54 result->SetTooltipText(style_info.tooltip); |
| 55 if (style_info.font_style != gfx::Font::NORMAL) { | 55 if (style_info.font_style != gfx::Font::NORMAL) { |
| 56 result->SetFontList( | 56 result->SetFontList( |
| 57 result->font_list().DeriveWithStyle(style_info.font_style)); | 57 result->font_list().DeriveWithStyle(style_info.font_style)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 return result.Pass(); | 60 return result; |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace | 63 } // namespace |
| 64 | 64 |
| 65 | 65 |
| 66 // StyledLabel::RangeStyleInfo ------------------------------------------------ | 66 // StyledLabel::RangeStyleInfo ------------------------------------------------ |
| 67 | 67 |
| 68 StyledLabel::RangeStyleInfo::RangeStyleInfo() | 68 StyledLabel::RangeStyleInfo::RangeStyleInfo() |
| 69 : font_style(gfx::Font::NORMAL), | 69 : font_style(gfx::Font::NORMAL), |
| 70 color(SK_ColorTRANSPARENT), | 70 color(SK_ColorTRANSPARENT), |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 DCHECK_LE(used_width, width); | 370 DCHECK_LE(used_width, width); |
| 371 // The user-specified line height only applies to interline spacing, so the | 371 // The user-specified line height only applies to interline spacing, so the |
| 372 // final line's height is unaffected. | 372 // final line's height is unaffected. |
| 373 int total_height = line * line_height + | 373 int total_height = line * line_height + |
| 374 CalculateLineHeight(font_list_) + GetInsets().height(); | 374 CalculateLineHeight(font_list_) + GetInsets().height(); |
| 375 calculated_size_ = gfx::Size(used_width + GetInsets().width(), total_height); | 375 calculated_size_ = gfx::Size(used_width + GetInsets().width(), total_height); |
| 376 return calculated_size_; | 376 return calculated_size_; |
| 377 } | 377 } |
| 378 | 378 |
| 379 } // namespace views | 379 } // namespace views |
| OLD | NEW |