OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef UI_VIEWS_STYLE_TYPOGRAPHY_H_ | 5 #ifndef UI_VIEWS_STYLE_TYPOGRAPHY_H_ |
6 #define UI_VIEWS_STYLE_TYPOGRAPHY_H_ | 6 #define UI_VIEWS_STYLE_TYPOGRAPHY_H_ |
7 | 7 |
8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
9 #include "ui/views/views_export.h" | 9 #include "ui/views/views_export.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... | |
26 | 26 |
27 // A title for a dialog window. Usually 15pt. Multi-line OK. | 27 // A title for a dialog window. Usually 15pt. Multi-line OK. |
28 CONTEXT_DIALOG_TITLE = VIEWS_TEXT_CONTEXT_START, | 28 CONTEXT_DIALOG_TITLE = VIEWS_TEXT_CONTEXT_START, |
29 | 29 |
30 // Text to label a control, usually next to it. "Body 2". Usually 12pt. | 30 // Text to label a control, usually next to it. "Body 2". Usually 12pt. |
31 CONTEXT_LABEL, | 31 CONTEXT_LABEL, |
32 | 32 |
33 // An editable text field. Usually matches CONTROL_LABEL. | 33 // An editable text field. Usually matches CONTROL_LABEL. |
34 CONTEXT_TEXTFIELD, | 34 CONTEXT_TEXTFIELD, |
35 | 35 |
36 // Text that appears on a button control. Usually 12pt. | 36 // Text that appears on a button control. This includes controls with |
37 // button-like behaviour, such as Checkbox. Usually 12pt. | |
37 CONTEXT_BUTTON, | 38 CONTEXT_BUTTON, |
38 | 39 |
40 // Text that appears on a button control under material design. | |
41 CONTEXT_BUTTON_MD, | |
Peter Kasting
2017/04/08 01:38:54
I don't think I understand why we have to introduc
tapted
2017/04/10 12:27:33
The problem is that CONTEXT_BUTTON would also used
Peter Kasting
2017/04/10 22:56:02
But the downside of this is that these are now the
tapted
2017/04/11 01:56:50
Yup. Have restored the separate MD context. I agre
Peter Kasting
2017/04/11 02:24:20
Right, but if we can eliminate that behavioral spe
tapted
2017/04/12 07:31:48
I don't think CONTEXT_BUTTON_MD makes sense for La
| |
42 | |
43 // Text for the menu items that appear in the touch-selection context menu. | |
44 CONTEXT_TOUCH_MENU, | |
45 | |
39 // Embedders must start TextContext enum values from this value. | 46 // Embedders must start TextContext enum values from this value. |
40 VIEWS_TEXT_CONTEXT_END, | 47 VIEWS_TEXT_CONTEXT_END, |
41 | 48 |
42 // All TextContext enum values must be below this value. | 49 // All TextContext enum values must be below this value. |
43 TEXT_CONTEXT_MAX = 0x1000 | 50 TEXT_CONTEXT_MAX = 0x1000 |
44 }; | 51 }; |
45 | 52 |
46 // How a piece of text should be presented. This influences color and style, but | 53 // How a piece of text should be presented. This influences color and style, but |
47 // typically not size. | 54 // typically not size. |
48 enum TextStyle { | 55 enum TextStyle { |
(...skipping 14 matching lines...) Expand all Loading... | |
63 | 70 |
64 // Active tab in a tabbed pane. | 71 // Active tab in a tabbed pane. |
65 STYLE_TAB_ACTIVE, | 72 STYLE_TAB_ACTIVE, |
66 | 73 |
67 // Hovered tab in a tabbed pane. | 74 // Hovered tab in a tabbed pane. |
68 STYLE_TAB_HOVERED, | 75 STYLE_TAB_HOVERED, |
69 | 76 |
70 // Inactive tab in a tabbed pane. | 77 // Inactive tab in a tabbed pane. |
71 STYLE_TAB_INACTIVE, | 78 STYLE_TAB_INACTIVE, |
72 | 79 |
80 // Style for the default button on a dialog. | |
81 STYLE_DEFAULT_DIALOG_BUTTON, | |
Peter Kasting
2017/04/08 01:38:54
Nit: I'm inclined to name this STYLE_BUTTON_DIALOG
tapted
2017/04/10 12:27:33
Done. I caved in and sorted some stuff too ;)
| |
82 | |
73 // Embedders must start TextStyle enum values from here. | 83 // Embedders must start TextStyle enum values from here. |
74 VIEWS_TEXT_STYLE_END | 84 VIEWS_TEXT_STYLE_END |
75 }; | 85 }; |
76 | 86 |
77 // Helpers to obtain font properties from the TypographyProvider given by the | 87 // Helpers to obtain font properties from the TypographyProvider given by the |
78 // current ViewsDelegate. |context| can be an enum value from TextContext, or a | 88 // current ViewsDelegate. |context| can be an enum value from TextContext, or a |
79 // value understood by the embedder's TypographyProvider. Similarly, | 89 // value understood by the embedder's TypographyProvider. Similarly, |
80 // |text_style| corresponds to TextStyle. | 90 // |text_style| corresponds to TextStyle. |
81 VIEWS_EXPORT const gfx::FontList& GetFont(int text_context, int text_style); | 91 VIEWS_EXPORT const gfx::FontList& GetFont(int text_context, int text_style); |
82 VIEWS_EXPORT SkColor GetColor(int text_context, int text_style); | 92 VIEWS_EXPORT SkColor GetColor(int text_context, int text_style); |
83 VIEWS_EXPORT int GetLineHeight(int text_context, int text_style); | 93 VIEWS_EXPORT int GetLineHeight(int text_context, int text_style); |
84 | 94 |
85 } // namespace style | 95 } // namespace style |
86 } // namespace views | 96 } // namespace views |
87 | 97 |
88 #endif // UI_VIEWS_STYLE_TYPOGRAPHY_H_ | 98 #endif // UI_VIEWS_STYLE_TYPOGRAPHY_H_ |
OLD | NEW |