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

Side by Side Diff: ash/common/system/tray/tray_popup_item_style.h

Issue 2244003002: Materialized font style for TrayItemMore type system tray rows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improved the TrayPopupItemStyle concept. 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 unified diff | Download patch
OLDNEW
(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_COMMON_SYSTEM_TRAY_TRAY_POPUP_ITEM_STYLE_H_
6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_ITEM_STYLE_H_
7
8 #include "base/observer_list.h"
9 #include "third_party/skia/include/core/SkColor.h"
10
11 namespace ui {
12 class NativeTheme;
13 } // namespace ui
14
15 namespace views {
16 class Label;
17 } // namespace views
18
19 namespace ash {
20 class TrayPopupItemStyleObserver;
21
22 // Central style provider for the system tray popup items. Makes it easier to
23 // ensure all visuals are consistent and easily updated in one spot instead of
24 // being defined in multiple places throughout the code.
25 class TrayPopupItemStyle {
26 public:
27 // The different visual styles that a row can have.
28 enum class ColorStyle {
29 // Active and clickable
30 ACTIVE,
31 // Inactive but clickable
32 INACTIVE,
33 // Disabled and not clickable
34 DISABLED,
35 };
36
37 // The different font styles that a row can have.
38 enum class FontStyle {
39 TITLE,
40 MAIN_PANEL_SECTION_ROW,
41 SUB_PANEL_SECTION_ROW,
42 SYSTEM_INFO,
43 CAPTION,
44 BUTTON,
45 };
46
47 TrayPopupItemStyle(const ui::NativeTheme* theme, FontStyle font_style);
48 virtual ~TrayPopupItemStyle();
49
50 void AddObserver(TrayPopupItemStyleObserver* observer);
51 void RemoveObserver(TrayPopupItemStyleObserver* observer);
52
53 const ui::NativeTheme* theme() const { return theme_; }
54
55 // Sets the |theme_| and notifies observers.
56 void SetTheme(const ui::NativeTheme* theme);
57
58 ColorStyle color_style() const { return color_style_; }
59
60 // Sets the |color_style_| and notifies observers if |color_style_| changed.
61 void SetColorStyle(ColorStyle color_style);
62
63 FontStyle font_style() const { return font_style_; }
64
65 // Sets the |font_style_| notifies observers if |font_style_| changed.
66 void SetFontStyle(FontStyle font_style);
67
68 SkColor GetForegroundColor() 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 void NotifyObserversStyleChanged();
75
76 // The theme that the styles are dervied from.
77 const ui::NativeTheme* theme_;
78
79 FontStyle font_style_;
80
81 ColorStyle color_style_;
82
83 base::ObserverList<TrayPopupItemStyleObserver> observers_;
84 };
85
86 } // namespace ash
87
88 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_ITEM_STYLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698