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 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 // preferred size of (0, 0) when it's not visible. | 159 // preferred size of (0, 0) when it's not visible. |
160 void set_collapse_when_hidden(bool value) { collapse_when_hidden_ = value; } | 160 void set_collapse_when_hidden(bool value) { collapse_when_hidden_ = value; } |
161 bool collapse_when_hidden() const { return collapse_when_hidden_; } | 161 bool collapse_when_hidden() const { return collapse_when_hidden_; } |
162 | 162 |
163 // Gets/set whether or not this label is to be painted as a focused element. | 163 // Gets/set whether or not this label is to be painted as a focused element. |
164 void set_paint_as_focused(bool paint_as_focused) { | 164 void set_paint_as_focused(bool paint_as_focused) { |
165 paint_as_focused_ = paint_as_focused; | 165 paint_as_focused_ = paint_as_focused; |
166 } | 166 } |
167 bool paint_as_focused() const { return paint_as_focused_; } | 167 bool paint_as_focused() const { return paint_as_focused_; } |
168 | 168 |
169 void set_elide_at_end(bool elide_at_end) { elide_at_end_ = elide_at_end; } | |
170 | |
169 void SetHasFocusBorder(bool has_focus_border); | 171 void SetHasFocusBorder(bool has_focus_border); |
170 | 172 |
171 // Overridden from View: | 173 // Overridden from View: |
172 virtual gfx::Insets GetInsets() const OVERRIDE; | 174 virtual gfx::Insets GetInsets() const OVERRIDE; |
173 virtual int GetBaseline() const OVERRIDE; | 175 virtual int GetBaseline() const OVERRIDE; |
174 // Overridden to compute the size required to display this label. | 176 // Overridden to compute the size required to display this label. |
175 virtual gfx::Size GetPreferredSize() OVERRIDE; | 177 virtual gfx::Size GetPreferredSize() OVERRIDE; |
176 // Returns the height necessary to display this label with the provided width. | 178 // Returns the height necessary to display this label with the provided width. |
177 // This method is used to layout multi-line labels. It is equivalent to | 179 // This method is used to layout multi-line labels. It is equivalent to |
178 // GetPreferredSize().height() if the receiver is not multi-line. | 180 // GetPreferredSize().height() if the receiver is not multi-line. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 SkColor requested_enabled_color_; | 260 SkColor requested_enabled_color_; |
259 SkColor actual_enabled_color_; | 261 SkColor actual_enabled_color_; |
260 SkColor requested_disabled_color_; | 262 SkColor requested_disabled_color_; |
261 SkColor actual_disabled_color_; | 263 SkColor actual_disabled_color_; |
262 SkColor background_color_; | 264 SkColor background_color_; |
263 bool auto_color_readability_; | 265 bool auto_color_readability_; |
264 mutable gfx::Size text_size_; | 266 mutable gfx::Size text_size_; |
265 mutable bool text_size_valid_; | 267 mutable bool text_size_valid_; |
266 bool is_multi_line_; | 268 bool is_multi_line_; |
267 bool allow_character_break_; | 269 bool allow_character_break_; |
268 bool elide_in_middle_; | 270 bool elide_in_middle_; |
sky
2012/08/07 19:41:59
Can we use ElideBehavior directly instead of two b
varunjain
2012/08/07 20:24:10
Done.
| |
271 bool elide_at_end_; | |
269 bool is_email_; | 272 bool is_email_; |
270 Alignment horiz_alignment_; | 273 Alignment horiz_alignment_; |
271 string16 tooltip_text_; | 274 string16 tooltip_text_; |
272 // Whether the mouse is over this label. | 275 // Whether the mouse is over this label. |
273 bool contains_mouse_; | 276 bool contains_mouse_; |
274 scoped_ptr<Background> mouse_over_background_; | 277 scoped_ptr<Background> mouse_over_background_; |
275 // Whether to collapse the label when it's not visible. | 278 // Whether to collapse the label when it's not visible. |
276 bool collapse_when_hidden_; | 279 bool collapse_when_hidden_; |
277 // The following member variable is used to control whether the | 280 // The following member variable is used to control whether the |
278 // directionality is auto-detected based on first strong directionality | 281 // directionality is auto-detected based on first strong directionality |
(...skipping 17 matching lines...) Expand all Loading... | |
296 // Should a shadow be drawn behind the text? | 299 // Should a shadow be drawn behind the text? |
297 bool has_shadow_; | 300 bool has_shadow_; |
298 | 301 |
299 | 302 |
300 DISALLOW_COPY_AND_ASSIGN(Label); | 303 DISALLOW_COPY_AND_ASSIGN(Label); |
301 }; | 304 }; |
302 | 305 |
303 } // namespace views | 306 } // namespace views |
304 | 307 |
305 #endif // UI_VIEWS_CONTROLS_LABEL_H_ | 308 #endif // UI_VIEWS_CONTROLS_LABEL_H_ |
OLD | NEW |