OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/system/tray/tray_popup_item_style.h" | 5 #include "ash/system/tray/tray_popup_item_style.h" |
6 | 6 |
7 #include "third_party/skia/include/core/SkColor.h" | 7 #include "third_party/skia/include/core/SkColor.h" |
8 #include "ui/gfx/color_palette.h" | 8 #include "ui/gfx/color_palette.h" |
9 #include "ui/gfx/font.h" | 9 #include "ui/gfx/font.h" |
10 #include "ui/gfx/font_list.h" | 10 #include "ui/gfx/font_list.h" |
11 #include "ui/native_theme/native_theme.h" | 11 #include "ui/native_theme/native_theme.h" |
12 #include "ui/views/controls/label.h" | 12 #include "ui/views/controls/label.h" |
13 | 13 |
14 namespace ash { | 14 namespace ash { |
15 namespace { | 15 namespace { |
16 | 16 |
17 const int kInactiveAlpha = 0x8A; | 17 constexpr int kInactiveAlpha = TrayPopupItemStyle::kInactiveIconAlpha * 0xFF; |
18 const int kDisabledAlpha = 0x61; | 18 constexpr int kDisabledAlpha = 0x61; |
19 | 19 |
20 } // namespace | 20 } // namespace |
21 | 21 |
22 // static | 22 // static |
23 SkColor TrayPopupItemStyle::GetIconColor(ColorStyle color_style) { | 23 SkColor TrayPopupItemStyle::GetIconColor(ColorStyle color_style) { |
24 switch (color_style) { | 24 switch (color_style) { |
25 case ColorStyle::ACTIVE: | 25 case ColorStyle::ACTIVE: |
26 return gfx::kChromeIconGrey; | 26 return gfx::kChromeIconGrey; |
27 case ColorStyle::INACTIVE: | 27 case ColorStyle::INACTIVE: |
28 return SkColorSetA(gfx::kChromeIconGrey, kInactiveAlpha); | 28 return SkColorSetA(gfx::kChromeIconGrey, kInactiveAlpha); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 gfx::Font::Weight::MEDIUM)); | 94 gfx::Font::Weight::MEDIUM)); |
95 break; | 95 break; |
96 case FontStyle::CAPTION: | 96 case FontStyle::CAPTION: |
97 label->SetFontList(base_font_list.Derive(0, gfx::Font::NORMAL, | 97 label->SetFontList(base_font_list.Derive(0, gfx::Font::NORMAL, |
98 gfx::Font::Weight::NORMAL)); | 98 gfx::Font::Weight::NORMAL)); |
99 break; | 99 break; |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 } // namespace ash | 103 } // namespace ash |
OLD | NEW |