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

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: fix 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
« no previous file with comments | « ash/common/system/tray/system_tray.cc ('k') | ui/native_theme/native_theme_dark_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2a19fab0ee98c1e499c7ebbdb07f2e57b49de34f 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()) {
+ // 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::MEDIUM));
+ } 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) {
« no previous file with comments | « ash/common/system/tray/system_tray.cc ('k') | ui/native_theme/native_theme_dark_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698