OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_STYLE_H_ | |
6 #define ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_STYLE_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "third_party/skia/include/core/SkColor.h" | |
10 | |
11 namespace views { | |
12 class Label; | |
13 } // namespace views | |
14 | |
15 namespace ash { | |
16 | |
17 // Central style provider for the system tray menu. Makes it easier to ensure | |
18 // all visuals are consistent and easily updated in one spot instead of being | |
19 // defined in multiple places throughout the code. | |
20 class TrayPopupItemStyle { | |
21 public: | |
22 // The different visual styles that a row can have. | |
23 enum class ColorStyle { | |
24 // Active and clickable. | |
25 ACTIVE, | |
26 // Inactive but clickable. | |
27 INACTIVE, | |
28 // Disabled and not clickable. | |
29 DISABLED, | |
30 // Color for "Connected" labels. | |
31 CONNECTED, | |
32 }; | |
33 | |
34 // The different font styles that row text can have. | |
35 enum class FontStyle { | |
36 // Topmost header rows for default view and detailed view. | |
37 TITLE, | |
38 // Main text used by default view rows. | |
39 DEFAULT_VIEW_LABEL, | |
40 // Text in sub-section header rows in detailed views. | |
41 SUB_HEADER, | |
42 // Main text used by detailed view rows. | |
43 DETAILED_VIEW_LABEL, | |
44 // System information text (e.g. date/time, battery status, etc). | |
45 SYSTEM_INFO, | |
46 // Child buttons within rows that have a visible border (e.g. Cast's | |
47 // "Stop", etc). | |
48 BUTTON, | |
49 // Sub text within a row (e.g. user name in user row). | |
50 CAPTION, | |
51 }; | |
52 | |
53 static SkColor GetIconColor(ColorStyle color_style); | |
54 | |
55 explicit TrayPopupItemStyle(FontStyle font_style); | |
56 ~TrayPopupItemStyle(); | |
57 | |
58 ColorStyle color_style() const { return color_style_; } | |
59 | |
60 void set_color_style(ColorStyle color_style) { color_style_ = color_style; } | |
61 | |
62 FontStyle font_style() const { return font_style_; } | |
63 | |
64 void set_font_style(FontStyle font_style) { font_style_ = font_style; } | |
65 | |
66 SkColor GetTextColor() const; | |
67 | |
68 SkColor GetIconColor() const; | |
69 | |
70 // Configures a Label as per the style (e.g. color, font). | |
71 void SetupLabel(views::Label* label) const; | |
72 | |
73 private: | |
74 FontStyle font_style_; | |
75 | |
76 ColorStyle color_style_; | |
77 | |
78 DISALLOW_COPY_AND_ASSIGN(TrayPopupItemStyle); | |
79 }; | |
80 | |
81 } // namespace ash | |
82 | |
83 #endif // ASH_SYSTEM_TRAY_TRAY_POPUP_ITEM_STYLE_H_ | |
OLD | NEW |