Commit e329c41e authored by Roman Aleksandrov's avatar Roman Aleksandrov Committed by Commit Bot

LoginUserView: Use Google Sans for displaying account name.

Bug: 1003888
Change-Id: Ic968514bdfbe23bbf4a0455cb5cf760d256b4e81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2042091
Commit-Queue: Roman Aleksandrov <raleksandrov@google.com>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740310}
parent 883cddc3
...@@ -65,6 +65,8 @@ constexpr float kOpaqueUserViewOpacity = 1.f; ...@@ -65,6 +65,8 @@ constexpr float kOpaqueUserViewOpacity = 1.f;
constexpr float kTransparentUserViewOpacity = 0.63f; constexpr float kTransparentUserViewOpacity = 0.63f;
constexpr float kUserFadeAnimationDurationMs = 180; constexpr float kUserFadeAnimationDurationMs = 180;
constexpr char kAccountNameFontFamily[] = "Google Sans";
constexpr char kUserViewClassName[] = "UserView"; constexpr char kUserViewClassName[] = "UserView";
constexpr char kLoginUserImageClassName[] = "LoginUserImage"; constexpr char kLoginUserImageClassName[] = "LoginUserImage";
constexpr char kLoginUserLabelClassName[] = "LoginUserLabel"; constexpr char kLoginUserLabelClassName[] = "LoginUserLabel";
...@@ -174,22 +176,24 @@ class LoginUserView::UserLabel : public NonAccessibleView { ...@@ -174,22 +176,24 @@ class LoginUserView::UserLabel : public NonAccessibleView {
user_name_->SetSubpixelRenderingEnabled(false); user_name_->SetSubpixelRenderingEnabled(false);
user_name_->SetAutoColorReadabilityEnabled(false); user_name_->SetAutoColorReadabilityEnabled(false);
// TODO(jdufault): Figure out the correct font.
const gfx::FontList& base_font_list = views::Label::GetDefaultFontList(); const gfx::FontList& base_font_list = views::Label::GetDefaultFontList();
const gfx::FontList font_list(
{kAccountNameFontFamily}, base_font_list.GetFontStyle(),
base_font_list.GetFontSize(), base_font_list.GetFontWeight());
switch (style) { switch (style) {
case LoginDisplayStyle::kLarge: case LoginDisplayStyle::kLarge:
user_name_->SetFontList(base_font_list.Derive( user_name_->SetFontList(font_list.Derive(
11, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::LIGHT)); 12, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::NORMAL));
break; break;
case LoginDisplayStyle::kSmall: case LoginDisplayStyle::kSmall:
user_name_->SetFontList(base_font_list.Derive( user_name_->SetFontList(font_list.Derive(
8, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::LIGHT)); 8, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::NORMAL));
break; break;
case LoginDisplayStyle::kExtraSmall: case LoginDisplayStyle::kExtraSmall:
// TODO(jdufault): match font against spec. // TODO(jdufault): match font against spec.
user_name_->SetFontList(base_font_list.Derive( user_name_->SetFontList(font_list.Derive(
6, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::LIGHT)); 6, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::NORMAL));
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment