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

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

Issue 312233003: Add fade eliding for Views Labels; related cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refine alignment check; minor additional cleanup. Created 6 years, 6 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
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label.h
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h
index 67b438ba52dc967b185454257467ab3ca5b2bd51..9e2881dc69e93262bcc05df9703e7902d3887b19 100644
--- a/ui/views/controls/label.h
+++ b/ui/views/controls/label.h
@@ -42,15 +42,6 @@ class VIEWS_EXPORT Label : public View {
AUTO_DETECT_DIRECTIONALITY
};
- enum ElideBehavior {
- NO_ELIDE, // Do not elide the label text; truncate as needed.
- ELIDE_AT_BEGINNING, // Add ellipsis at the start of the string as needed.
- ELIDE_IN_MIDDLE, // Add ellipsis in the middle of the string as needed.
- ELIDE_AT_END, // Add ellipsis at the end of the string as needed.
- ELIDE_AS_EMAIL, // Elide while retaining username/domain chars
- // as needed.
- };
-
// Internal class name.
static const char kViewClassName[];
@@ -150,10 +141,9 @@ 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 or end (if
- // necessary). The default is to elide at the end.
- // NOTE: Eliding in the middle is not supported for multi-line strings.
- void SetElideBehavior(ElideBehavior elide_behavior);
+ // Sets the eliding or fading behavior, applied as necessary. The default is
+ // to elide at the end. Eliding is not well supported for multi-line labels.
+ void SetElideBehavior(gfx::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
@@ -277,7 +267,7 @@ class VIEWS_EXPORT Label : public View {
bool is_multi_line_;
bool is_obscured_;
bool allow_character_break_;
- ElideBehavior elide_behavior_;
+ gfx::ElideBehavior elide_behavior_;
gfx::HorizontalAlignment horizontal_alignment_;
base::string16 tooltip_text_;
// Whether to collapse the label when it's not visible.
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698