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

Side by Side Diff: ui/views/controls/label.h

Issue 14654018: Make Label's NO_ELIDE setting actually not elide, and change the default (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/message_center/views/notification_view.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 // Get or set if the label text can wrap on multiple lines; default is false. 126 // Get or set if the label text can wrap on multiple lines; default is false.
127 bool is_multi_line() const { return is_multi_line_; } 127 bool is_multi_line() const { return is_multi_line_; }
128 void SetMultiLine(bool multi_line); 128 void SetMultiLine(bool multi_line);
129 129
130 // Sets whether the label text can be split on words. 130 // Sets whether the label text can be split on words.
131 // Default is false. This only works when is_multi_line is true. 131 // Default is false. This only works when is_multi_line is true.
132 void SetAllowCharacterBreak(bool allow_character_break); 132 void SetAllowCharacterBreak(bool allow_character_break);
133 133
134 // Sets whether the label text should be elided in the middle or end (if 134 // Sets whether the label text should be elided in the middle or end (if
135 // necessary). The default is to not elide at all. 135 // necessary). The default is to to elide at the end.
Alexei Svitkine (slow) 2013/05/17 13:49:52 Nit: "to to" -> "to"
136 // NOTE: Eliding in the middle is not supported for multi-line strings. 136 // NOTE: Eliding in the middle is not supported for multi-line strings.
137 void SetElideBehavior(ElideBehavior elide_behavior); 137 void SetElideBehavior(ElideBehavior elide_behavior);
138 138
139 // Sets the tooltip text. Default behavior for a label (single-line) is to 139 // Sets the tooltip text. Default behavior for a label (single-line) is to
140 // show the full text if it is wider than its bounds. Calling this overrides 140 // show the full text if it is wider than its bounds. Calling this overrides
141 // the default behavior and lets you set a custom tooltip. To revert to 141 // the default behavior and lets you set a custom tooltip. To revert to
142 // default behavior, call this with an empty string. 142 // default behavior, call this with an empty string.
143 void SetTooltipText(const string16& tooltip_text); 143 void SetTooltipText(const string16& tooltip_text);
144 144
145 // Resizes the label so its width is set to the width of the longest line and 145 // Resizes the label so its width is set to the width of the longest line and
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // The cached heights to avoid recalculation in GetHeightForWidth(). 281 // The cached heights to avoid recalculation in GetHeightForWidth().
282 std::vector<gfx::Size> cached_heights_; 282 std::vector<gfx::Size> cached_heights_;
283 int cached_heights_cursor_; 283 int cached_heights_cursor_;
284 284
285 DISALLOW_COPY_AND_ASSIGN(Label); 285 DISALLOW_COPY_AND_ASSIGN(Label);
286 }; 286 };
287 287
288 } // namespace views 288 } // namespace views
289 289
290 #endif // UI_VIEWS_CONTROLS_LABEL_H_ 290 #endif // UI_VIEWS_CONTROLS_LABEL_H_
OLDNEW
« no previous file with comments | « ui/message_center/views/notification_view.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698