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

Unified Diff: ui/views/controls/tabbed_pane/tabbed_pane.cc

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes for review issues. Created 4 years, 9 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: ui/views/controls/tabbed_pane/tabbed_pane.cc
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.cc b/ui/views/controls/tabbed_pane/tabbed_pane.cc
index 5579bb07c041f27a2f0d8c80d927163f935b5420..c890345f1ab692fc3546c7dd87f524efc6903ef7 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane.cc
@@ -28,9 +28,9 @@ const SkColor kTabTitleColor_Hovered = SK_ColorBLACK;
const SkColor kTabBorderColor = SkColorSetRGB(0xC8, 0xC8, 0xC8);
const SkScalar kTabBorderThickness = 1.0f;
-const gfx::Font::FontStyle kHoverStyle = gfx::Font::NORMAL;
-const gfx::Font::FontStyle kActiveStyle = gfx::Font::BOLD;
-const gfx::Font::FontStyle kInactiveStyle = gfx::Font::NORMAL;
+const gfx::Font::Weight kHoverWeight = gfx::Font::Weight::NORMAL;
+const gfx::Font::Weight kActiveWeight = gfx::Font::Weight::BOLD;
+const gfx::Font::Weight kInactiveWeight = gfx::Font::Weight::NORMAL;
} // namespace
@@ -111,7 +111,8 @@ Tab::Tab(TabbedPane* tabbed_pane, const base::string16& title, View* contents)
title,
ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(
ui::kLabelFontSizeDelta,
- kActiveStyle))),
+ gfx::Font::NORMAL,
msw 2016/03/22 18:24:11 nit: wrap above (git cl format?)
Mikus 2016/03/23 17:53:22 This is what git cl format suggests
+ kActiveWeight))),
tab_state_(TAB_ACTIVE),
contents_(contents) {
// Calculate this now while the font list is guaranteed to be bold.
@@ -189,18 +190,18 @@ void Tab::SetState(TabState tab_state) {
switch (tab_state) {
case TAB_INACTIVE:
title_->SetEnabledColor(kTabTitleColor_Inactive);
- title_->SetFontList(
- rb.GetFontListWithDelta(ui::kLabelFontSizeDelta, kInactiveStyle));
+ title_->SetFontList(rb.GetFontListWithDelta(
+ ui::kLabelFontSizeDelta, gfx::Font::NORMAL, kInactiveWeight));
break;
case TAB_ACTIVE:
title_->SetEnabledColor(kTabTitleColor_Active);
- title_->SetFontList(
- rb.GetFontListWithDelta(ui::kLabelFontSizeDelta, kActiveStyle));
+ title_->SetFontList(rb.GetFontListWithDelta(
+ ui::kLabelFontSizeDelta, gfx::Font::NORMAL, kActiveWeight));
break;
case TAB_HOVERED:
title_->SetEnabledColor(kTabTitleColor_Hovered);
- title_->SetFontList(
- rb.GetFontListWithDelta(ui::kLabelFontSizeDelta, kHoverStyle));
+ title_->SetFontList(rb.GetFontListWithDelta(
+ ui::kLabelFontSizeDelta, gfx::Font::NORMAL, kHoverWeight));
break;
}
SchedulePaint();
« ui/views/controls/styled_label_unittest.cc ('K') | « ui/views/controls/styled_label_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698