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

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

Issue 2307843002: views: use theme colors for TabbedPane (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | 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 e4a2f87c325167d101a1ca28218d7cdeac27fec1..44ee83e748e0c182a027b9a7c2da94ea468c82a8 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane.cc
@@ -15,6 +15,7 @@
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font_list.h"
+#include "ui/native_theme/native_theme.h"
#include "ui/views/border.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h"
@@ -261,18 +262,17 @@ MdTab::MdTab(TabbedPane* tabbed_pane,
MdTab::~MdTab() {}
void MdTab::OnStateChanged() {
- // These values are directly from the Harmony specs for tabbed panes.
- const SkColor kSelectedBorderColor = SkColorSetRGB(0x42, 0x85, 0xF4);
- const SkColor kNormalBorderColor = SkColorSetARGB(0x23, 0x00, 0x00, 0x00);
- const SkColor kSelectedFontColor = SkColorSetRGB(0x42, 0x85, 0xF4);
- const SkColor kNormalFontColor = SkColorSetRGB(0x5A, 0x5A, 0x5A);
-
- SkColor border_color = selected() ? kSelectedBorderColor : kNormalBorderColor;
+ ui::NativeTheme* theme = GetNativeTheme();
+ SkColor border_color = selected()
+ ? theme->GetSystemColor(ui::NativeTheme::kColorId_FocusedBorderColor)
Evan Stade 2016/09/06 17:04:28 nit: move ternary inside GetSystemColor
+ : theme->GetSystemColor(ui::NativeTheme::kColorId_UnfocusedBorderColor);
int border_thickness = selected() ? 2 : 1;
SetBorder(
Border::CreateSolidSidedBorder(0, 0, border_thickness, 0, border_color));
- SkColor font_color = selected() ? kSelectedFontColor : kNormalFontColor;
+ SkColor font_color = selected()
+ ? theme->GetSystemColor(ui::NativeTheme::kColorId_CallToActionColor)
+ : theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonEnabledColor);
title()->SetEnabledColor(font_color);
gfx::Font::Weight font_weight = gfx::Font::Weight::NORMAL;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698