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

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: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 years, 7 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 | « ui/views/controls/styled_label_unittest.cc ('k') | ui/views/examples/multiline_example.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8b948e70bbf76121441d0a67e89fe766922398f6..0be0af67873e0948c454dff219caca04212ab0a4 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,
+ 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();
« no previous file with comments | « ui/views/controls/styled_label_unittest.cc ('k') | ui/views/examples/multiline_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698