Index: ui/views/controls/button/label_button.cc |
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc |
index 8768c31e1fd398fdc0f9dabe79acdfe15328b746..c4e6e2e39a49521863d1722ff380b89fbd070c97 100644 |
--- a/ui/views/controls/button/label_button.cc |
+++ b/ui/views/controls/button/label_button.cc |
@@ -30,6 +30,17 @@ const SkColor kStyleButtonTextColor = SK_ColorBLACK; |
const SkColor kStyleButtonShadowColor = SK_ColorWHITE; |
#endif |
+const gfx::FontList& GetDefaultNormalFontList() { |
+ static const gfx::FontList kNormalFontList = gfx::FontList(); |
sky
2014/09/15 19:15:34
Style guide says no statics like this. I think the
msw
2014/09/15 20:51:42
Done.
|
+ return kNormalFontList; |
+} |
+ |
+const gfx::FontList& GetDefaultBoldFontList() { |
+ static const gfx::FontList kBoldFontList = gfx::FontList(). |
+ DeriveWithStyle(gfx::FontList().GetFontStyle() | gfx::Font::BOLD); |
+ return kBoldFontList; |
+} |
+ |
} // namespace |
namespace views { |
@@ -44,6 +55,8 @@ LabelButton::LabelButton(ButtonListener* listener, const base::string16& text) |
: CustomButton(listener), |
image_(new ImageView()), |
label_(new Label()), |
+ cached_normal_font_list_(GetDefaultNormalFontList()), |
+ cached_bold_font_list_(GetDefaultBoldFontList()), |
button_state_images_(), |
button_state_colors_(), |
explicitly_set_colors_(), |
@@ -53,12 +66,12 @@ LabelButton::LabelButton(ButtonListener* listener, const base::string16& text) |
image_label_spacing_(kSpacing) { |
SetAnimationDuration(kHoverAnimationDurationMs); |
SetText(text); |
- SetFontList(gfx::FontList()); |
AddChildView(image_); |
image_->set_interactive(false); |
AddChildView(label_); |
+ label_->SetFontList(cached_normal_font_list_); |
label_->SetAutoColorReadabilityEnabled(false); |
label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |