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

Unified Diff: ash/common/system/tray/tray_utils.cc

Issue 2254933002: Reuse NativeThemeAuraDark for cros tray. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: inject NativeTheme at widget Created 4 years, 4 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: ash/common/system/tray/tray_utils.cc
diff --git a/ash/common/system/tray/tray_utils.cc b/ash/common/system/tray/tray_utils.cc
index 55769743368e960297d9b528feab1de1023f9beb..c5cf2a1441002b654075985a8f948763702109dc 100644
--- a/ash/common/system/tray/tray_utils.cc
+++ b/ash/common/system/tray/tray_utils.cc
@@ -4,6 +4,7 @@
#include "ash/common/system/tray/tray_utils.h"
+#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_item_view.h"
@@ -16,14 +17,22 @@
namespace ash {
void SetupLabelForTray(views::Label* label) {
- label->SetFontList(
- gfx::FontList().Derive(1, gfx::Font::NORMAL, gfx::Font::Weight::BOLD));
- label->SetAutoColorReadabilityEnabled(false);
- label->SetEnabledColor(SK_ColorWHITE);
- label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255));
- label->SetShadows(gfx::ShadowValues(
- 1,
- gfx::ShadowValue(gfx::Vector2d(0, 1), 0, SkColorSetARGB(64, 0, 0, 0))));
+ if (MaterialDesignController::IsShelfMaterial()) {
Evan Stade 2016/08/18 00:38:02 I went ahead and made changes here to match Sebast
+ // The text is drawn on an transparent bg, so we must disable subpixel
+ // rendering.
+ label->SetSubpixelRenderingEnabled(false);
+ label->SetFontList(
+ gfx::FontList().Derive(2, gfx::Font::NORMAL, gfx::Font::Weight::BOLD));
+ } else {
+ label->SetFontList(
+ gfx::FontList().Derive(1, gfx::Font::NORMAL, gfx::Font::Weight::BOLD));
+ label->SetShadows(gfx::ShadowValues(
+ 1,
+ gfx::ShadowValue(gfx::Vector2d(0, 1), 0, SkColorSetARGB(64, 0, 0, 0))));
+ label->SetAutoColorReadabilityEnabled(false);
+ label->SetEnabledColor(SK_ColorWHITE);
+ label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255));
+ }
}
void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment) {

Powered by Google App Engine
This is Rietveld 408576698