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

Unified Diff: ui/views/controls/label.h

Issue 10834207: aura: Long launcher tooltips should elide at end. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/label.h
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h
index 3881e8fa613073f0ff9253bc76612649e6ce7ae6..3cb14ca2586ff7f88cb10882ec83f3c973275687 100644
--- a/ui/views/controls/label.h
+++ b/ui/views/controls/label.h
@@ -44,6 +44,12 @@ class VIEWS_EXPORT Label : public View {
AUTO_DETECT_DIRECTIONALITY
};
+ enum ElideBehavior {
+ NO_ELIDE,
+ ELIDE_IN_MIDDLE,
+ ELIDE_AT_END,
+ };
+
// The view class name.
static const char kViewClassName[];
@@ -130,10 +136,10 @@ class VIEWS_EXPORT Label : public View {
// Default is false. This only works when is_multi_line is true.
void SetAllowCharacterBreak(bool allow_character_break);
- // Sets whether the label text should be elided in the middle (if necessary).
- // The default is to elide at the end.
- // NOTE: This is not supported for multi-line strings.
- void SetElideInMiddle(bool elide_in_middle);
+ // Sets whether the label text should be elided in the middle or end (if
+ // necessary). The default is to not elide at all.
+ // NOTE: Eliding in the middle is not supported for multi-line strings.
+ void SetElideBehavior(ElideBehavior elide_behavior);
// Sets the tooltip text. Default behavior for a label (single-line) is to
// show the full text if it is wider than its bounds. Calling this overrides
@@ -265,7 +271,7 @@ class VIEWS_EXPORT Label : public View {
mutable bool text_size_valid_;
bool is_multi_line_;
bool allow_character_break_;
- bool elide_in_middle_;
+ ElideBehavior elide_behavior_;
bool is_email_;
Alignment horiz_alignment_;
string16 tooltip_text_;

Powered by Google App Engine
This is Rietveld 408576698