OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CONTROLS_LABEL_H_ | 5 #ifndef UI_VIEWS_CONTROLS_LABEL_H_ |
6 #define UI_VIEWS_CONTROLS_LABEL_H_ | 6 #define UI_VIEWS_CONTROLS_LABEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 // will force the text color to be readable over it. | 87 // will force the text color to be readable over it. |
88 void SetBackgroundColor(SkColor color); | 88 void SetBackgroundColor(SkColor color); |
89 SkColor background_color() const { return background_color_; } | 89 SkColor background_color() const { return background_color_; } |
90 | 90 |
91 // Enables a drop shadow underneath the text. | 91 // Enables a drop shadow underneath the text. |
92 void SetShadowColors(SkColor enabled_color, SkColor disabled_color); | 92 void SetShadowColors(SkColor enabled_color, SkColor disabled_color); |
93 | 93 |
94 // Sets the drop shadow's offset from the text. | 94 // Sets the drop shadow's offset from the text. |
95 void SetShadowOffset(int x, int y); | 95 void SetShadowOffset(int x, int y); |
96 | 96 |
97 // Sets the shadow blur. Default is zero. | |
98 double shadow_blur() const { return shadow_blur_; } | |
99 void SetShadowBlur(double shadow_blur_); | |
flackr
2014/04/14 20:31:18
Trivial plain old data type setters should be inli
Nina
2014/04/15 15:15:03
Done.
| |
100 | |
101 // If true, let the shadow surround the text. Default is false. | |
102 bool mirror_shadow() const { return mirror_shadow_; } | |
103 void SetMirrorShadow(bool mirror_shadow); | |
flackr
2014/04/14 20:31:18
ditto.
Nina
2014/04/15 15:15:03
Done. Actually, removed.
| |
104 | |
97 // Disables shadows. | 105 // Disables shadows. |
98 void ClearEmbellishing(); | 106 void ClearEmbellishing(); |
99 | 107 |
100 // Sets horizontal alignment. If the locale is RTL, and the directionality | 108 // Sets horizontal alignment. If the locale is RTL, and the directionality |
101 // mode is USE_UI_DIRECTIONALITY, the alignment is flipped around. | 109 // mode is USE_UI_DIRECTIONALITY, the alignment is flipped around. |
102 // | 110 // |
103 // Caveat: for labels originating from a web page, the directionality mode | 111 // Caveat: for labels originating from a web page, the directionality mode |
104 // should be reset to AUTO_DETECT_DIRECTIONALITY before the horizontal | 112 // should be reset to AUTO_DETECT_DIRECTIONALITY before the horizontal |
105 // alignment is set. Otherwise, the label's alignment specified as a parameter | 113 // alignment is set. Otherwise, the label's alignment specified as a parameter |
106 // will be flipped in RTL locales. | 114 // will be flipped in RTL locales. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 SkColor background_color_; | 268 SkColor background_color_; |
261 | 269 |
262 // Set to true once the corresponding setter is invoked. | 270 // Set to true once the corresponding setter is invoked. |
263 bool enabled_color_set_; | 271 bool enabled_color_set_; |
264 bool disabled_color_set_; | 272 bool disabled_color_set_; |
265 bool background_color_set_; | 273 bool background_color_set_; |
266 | 274 |
267 bool auto_color_readability_; | 275 bool auto_color_readability_; |
268 mutable gfx::Size text_size_; | 276 mutable gfx::Size text_size_; |
269 mutable bool text_size_valid_; | 277 mutable bool text_size_valid_; |
278 // Indicates the level of shadow blurring. Default is zero. | |
279 double shadow_blur_; | |
270 int line_height_; | 280 int line_height_; |
271 bool is_multi_line_; | 281 bool is_multi_line_; |
272 bool is_obscured_; | 282 bool is_obscured_; |
273 bool allow_character_break_; | 283 bool allow_character_break_; |
274 ElideBehavior elide_behavior_; | 284 ElideBehavior elide_behavior_; |
275 gfx::HorizontalAlignment horizontal_alignment_; | 285 gfx::HorizontalAlignment horizontal_alignment_; |
276 base::string16 tooltip_text_; | 286 base::string16 tooltip_text_; |
277 // Whether to collapse the label when it's not visible. | 287 // Whether to collapse the label when it's not visible. |
278 bool collapse_when_hidden_; | 288 bool collapse_when_hidden_; |
279 // The following member variable is used to control whether the | 289 // The following member variable is used to control whether the |
280 // directionality is auto-detected based on first strong directionality | 290 // directionality is auto-detected based on first strong directionality |
281 // character or is determined by chrome UI's locale. | 291 // character or is determined by chrome UI's locale. |
282 DirectionalityMode directionality_mode_; | 292 DirectionalityMode directionality_mode_; |
283 | 293 |
284 // Colors for shadow. | 294 // Colors for shadow. |
285 SkColor enabled_shadow_color_; | 295 SkColor enabled_shadow_color_; |
286 SkColor disabled_shadow_color_; | 296 SkColor disabled_shadow_color_; |
287 | 297 |
288 // Space between text and shadow. | 298 // Space between text and shadow. |
289 gfx::Point shadow_offset_; | 299 gfx::Point shadow_offset_; |
290 | 300 |
291 // Should a shadow be drawn behind the text? | 301 // Should a shadow be drawn behind the text? |
292 bool has_shadow_; | 302 bool has_shadow_; |
293 | 303 |
304 // If true, surrender the text with the shadow. Default is false. | |
flackr
2014/04/14 20:31:18
What do you mean by surrender the text with the sh
Nina
2014/04/15 15:15:03
This was removed, but anyway...
I mean that if th
| |
305 bool mirror_shadow_; | |
306 | |
294 // The cached heights to avoid recalculation in GetHeightForWidth(). | 307 // The cached heights to avoid recalculation in GetHeightForWidth(). |
295 std::vector<gfx::Size> cached_heights_; | 308 std::vector<gfx::Size> cached_heights_; |
296 int cached_heights_cursor_; | 309 int cached_heights_cursor_; |
297 | 310 |
298 DISALLOW_COPY_AND_ASSIGN(Label); | 311 DISALLOW_COPY_AND_ASSIGN(Label); |
299 }; | 312 }; |
300 | 313 |
301 } // namespace views | 314 } // namespace views |
302 | 315 |
303 #endif // UI_VIEWS_CONTROLS_LABEL_H_ | 316 #endif // UI_VIEWS_CONTROLS_LABEL_H_ |
OLD | NEW |