Commit fcf27422 authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Commit Bot

Fix fonts for tray bubbles

Bring fonts for system tray and secondary trays up tp new spec.

Bug: 1145336
Change-Id: If5c102d94e21e1b84f5554896126e0acd681c77f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2548404
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarMin Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829956}
parent be74961b
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "ash/system/dark_mode/dark_mode_detailed_view.h"
#include <cstddef>
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/strings/grit/ash_strings.h"
......@@ -120,8 +121,10 @@ const char* DarkModeDetailedView::GetClassName() const {
void DarkModeDetailedView::OnThemeChanged() {
TrayDetailedView::OnThemeChanged();
themed_label_->SetEnabledColor(GetLabelColor());
neutral_label_->SetEnabledColor(GetLabelColor());
TrayPopupUtils::SetLabelFontList(themed_label_,
TrayPopupUtils::FontStyle::kSystemInfo);
TrayPopupUtils::SetLabelFontList(neutral_label_,
TrayPopupUtils::FontStyle::kSystemInfo);
TrayPopupUtils::UpdateToggleButtonColors(toggle_);
}
......
......@@ -135,7 +135,7 @@ class ImeTitleView : public views::View {
title_label->SetEnabledColor(color_provider->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary));
TrayPopupUtils::SetLabelFontList(title_label,
TrayPopupUtils::FontStyle::kSubHeader);
TrayPopupUtils::FontStyle::kPodMenuHeader);
layout_ptr->SetFlexForView(title_label, 1);
settings_button_ = AddChildView(std::make_unique<TopShortcutButton>(
......
......@@ -105,7 +105,7 @@ class TitleView : public views::View {
title_label->SetEnabledColor(AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary));
TrayPopupUtils::SetLabelFontList(title_label,
TrayPopupUtils::FontStyle::kSmallTitle);
TrayPopupUtils::FontStyle::kPodMenuHeader);
layout_ptr->SetFlexForView(title_label, 1);
help_button_ = AddChildView(std::make_unique<TopShortcutButton>(
base::BindRepeating(
......
......@@ -369,21 +369,30 @@ void TrayPopupUtils::UpdateToggleButtonColors(views::ToggleButton* toggle) {
void TrayPopupUtils::SetLabelFontList(views::Label* label, FontStyle style) {
label->SetAutoColorReadabilityEnabled(false);
const gfx::FontList& base_font_list = views::Label::GetDefaultFontList();
const gfx::FontList google_sans_font_list({"Google Sans"}, gfx::Font::NORMAL,
16, gfx::Font::Weight::MEDIUM);
const gfx::FontList roboto_font_list({"Roboto"}, gfx::Font::NORMAL, 16,
gfx::Font::Weight::MEDIUM);
switch (style) {
case FontStyle::kTitle:
label->SetFontList(base_font_list.Derive(8, gfx::Font::NORMAL,
gfx::Font::Weight::MEDIUM));
label->SetFontList(google_sans_font_list);
break;
case FontStyle::kPodMenuHeader:
label->SetFontList(roboto_font_list);
break;
case FontStyle::kSubHeader:
label->SetFontList(base_font_list.Derive(4, gfx::Font::NORMAL,
gfx::Font::Weight::MEDIUM));
label->SetFontList(roboto_font_list.Derive(-1, gfx::Font::NORMAL,
gfx::Font::Weight::MEDIUM));
break;
case FontStyle::kSmallTitle:
label->SetFontList(roboto_font_list.Derive(-3, gfx::Font::NORMAL,
gfx::Font::Weight::MEDIUM));
break;
case FontStyle::kDetailedViewLabel:
case FontStyle::kSystemInfo:
label->SetFontList(base_font_list.Derive(1, gfx::Font::NORMAL,
gfx::Font::Weight::NORMAL));
label->SetFontList(roboto_font_list.Derive(-4, gfx::Font::NORMAL,
gfx::Font::Weight::NORMAL));
break;
}
}
......
......@@ -38,7 +38,9 @@ class TrayPopupUtils {
enum class FontStyle {
// Topmost header rows for default view and detailed view.
kTitle,
// Topmost header rows for secondary tray bubbles.
// Topmost header for secondary tray bubbles
kPodMenuHeader,
// Small title used for selections in tray bubbles.
kSmallTitle,
// Text in sub-section header rows in detailed views.
kSubHeader,
......
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