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

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

Issue 470053004: [Win, Linux] Always display the avatar button text at the same size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pull out omnibox code to a common place Created 6 years, 4 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
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 99a62030508db329d3e8417a9fcc0b35cf0dbeee..56b153d675c0c84770c8734ec2b5838ed7f6d3b4 100644
--- a/chrome/browser/ui/views/profiles/new_avatar_button.cc
+++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc
@@ -18,6 +18,8 @@
namespace {
+const int kDisplayFontHeight = 15;
Peter Kasting 2014/08/28 19:34:17 Where does this come from? Can we derive this fro
msw 2014/08/28 19:40:03 Was this height derived visually from the button a
noms (inactive) 2014/08/28 20:36:25 Hmm, it was, yes. Working on getting something bet
msw 2014/08/28 21:43:50 Give it a shot, I'd be okay with a literal (and a
noms (inactive) 2014/08/29 17:10:29 I went with adding a comment. Button height + inse
+
scoped_ptr<views::Border> CreateBorder(const int normal_image_set[],
const int hot_image_set[],
const int pushed_image_set[]) {
@@ -59,6 +61,10 @@ NewAvatarButton::NewAvatarButton(
gfx::ShadowValue(gfx::Point(), 1.0f, SK_ColorDKGRAY)));
SetTextSubpixelRenderingEnabled(false);
+ // Shrink large fonts to make them fit.
+ SetFontList(GetFontList().GetLargestFontListWithHeightBound(
+ kDisplayFontHeight));
+
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
if (button_style == THEMED_BUTTON) {
const int kNormalImageSet[] = IMAGE_GRID(IDR_AVATAR_THEMED_BUTTON_NORMAL);

Powered by Google App Engine
This is Rietveld 408576698