Chromium Code Reviews| Index: chrome/browser/ui/views/profiles/new_avatar_button.cc |
| diff --git a/chrome/browser/ui/views/profiles/new_avatar_button.cc b/chrome/browser/ui/views/profiles/new_avatar_button.cc |
| index b30f7746c14875f19ed2dd473537e3eb1322e347..cabfa1357bff0892185b9805dde4e52731e56503 100644 |
| --- a/chrome/browser/ui/views/profiles/new_avatar_button.cc |
| +++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc |
| @@ -19,6 +19,10 @@ |
| namespace { |
| +// The largest text height that fits in the control. If the font list height |
| +// is larger than this, it will be shrunk to match it. |
| +const int kDisplayFontHeight = 15; |
|
msw
2014/08/29 17:25:58
nit: move this constant down to where its used (fu
noms (inactive)
2014/08/29 18:03:20
Done.
|
| + |
| scoped_ptr<views::Border> CreateBorder(const int normal_image_set[], |
| const int hot_image_set[], |
| const int pushed_image_set[]) { |
| @@ -61,6 +65,9 @@ NewAvatarButton::NewAvatarButton( |
| gfx::ShadowValue(gfx::Point(), 1.0f, SK_ColorDKGRAY))); |
| SetTextSubpixelRenderingEnabled(false); |
| + // Shrink large fonts to make them fit. |
| + SetFontList(GetFontList().DeriveWithHeightUpperBound(kDisplayFontHeight)); |
| + |
| ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| if (button_style == THEMED_BUTTON) { |
| const int kNormalImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_NORMAL); |