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

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

Issue 1689623004: Start removing enum ui::ResourceBundle::FontStyle, fix MacViews font sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix transcription error Created 4 years, 10 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/label.cc ('k') | ui/views/controls/textfield/textfield.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 eb15ac9a3be5f0cd0da1c24b2a70510dd8aa076a..5579bb07c041f27a2f0d8c80d927163f935b5420 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane.cc
@@ -9,6 +9,7 @@
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/accessibility/ax_view_state.h"
+#include "ui/base/default_style.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas.h"
@@ -27,6 +28,10 @@ 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;
+
} // namespace
namespace views {
@@ -102,9 +107,11 @@ const char Tab::kViewClassName[] = "Tab";
Tab::Tab(TabbedPane* tabbed_pane, const base::string16& title, View* contents)
: tabbed_pane_(tabbed_pane),
- title_(new Label(title,
- ui::ResourceBundle::GetSharedInstance().GetFontList(
- ui::ResourceBundle::BoldFont))),
+ title_(new Label(
+ title,
+ ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(
+ ui::kLabelFontSizeDelta,
+ kActiveStyle))),
tab_state_(TAB_ACTIVE),
contents_(contents) {
// Calculate this now while the font list is guaranteed to be bold.
@@ -182,15 +189,18 @@ void Tab::SetState(TabState tab_state) {
switch (tab_state) {
case TAB_INACTIVE:
title_->SetEnabledColor(kTabTitleColor_Inactive);
- title_->SetFontList(rb.GetFontList(ui::ResourceBundle::BaseFont));
+ title_->SetFontList(
+ rb.GetFontListWithDelta(ui::kLabelFontSizeDelta, kInactiveStyle));
break;
case TAB_ACTIVE:
title_->SetEnabledColor(kTabTitleColor_Active);
- title_->SetFontList(rb.GetFontList(ui::ResourceBundle::BoldFont));
+ title_->SetFontList(
+ rb.GetFontListWithDelta(ui::kLabelFontSizeDelta, kActiveStyle));
break;
case TAB_HOVERED:
title_->SetEnabledColor(kTabTitleColor_Hovered);
- title_->SetFontList(rb.GetFontList(ui::ResourceBundle::BaseFont));
+ title_->SetFontList(
+ rb.GetFontListWithDelta(ui::kLabelFontSizeDelta, kHoverStyle));
break;
}
SchedulePaint();
« no previous file with comments | « ui/views/controls/label.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698