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

Unified Diff: chrome/browser/ui/views/profiles/new_avatar_button.cc

Issue 534713002: [Merge] [Win, Linux] Always display the avatar button text at the same size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 years, 3 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | ui/gfx/font_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2e3647c1048c58ac38e75dc08ce4293267778971 100644
--- a/chrome/browser/ui/views/profiles/new_avatar_button.cc
+++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc
@@ -61,6 +61,12 @@ NewAvatarButton::NewAvatarButton(
gfx::ShadowValue(gfx::Point(), 1.0f, SK_ColorDKGRAY)));
SetTextSubpixelRenderingEnabled(false);
+ // The largest text height that fits in the button. If the font list height
+ // is larger than this, it will be shrunk to match it.
+ // TODO(noms): Calculate this constant algorithmically.
+ const int kDisplayFontHeight = 15;
+ 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);
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | ui/gfx/font_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698