aboutsummaryrefslogtreecommitdiff
path: root/AppKit/GTMFadeTruncatingTextFieldCell.h
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2011-03-18 21:00:21 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2011-03-18 21:00:21 +0000
commitfb696efd169db17e8169d0d0cfd1caf0728c0722 (patch)
treec5e617df9d40b77132892abb3d0264dca3a8e56a /AppKit/GTMFadeTruncatingTextFieldCell.h
parent72bd0c479793ffcd5a78696da9ba27e8b26c8e3e (diff)
[Author: sail]
Currently GTMFadeTruncatingTextFieldCell only supports truncating the tail of a string. It should also allow the head of a string to be truncated. I'd like to use this in Chromium. See http://crbug.com/69304 R=thomasvl APPROVED=thomasvl DELTA=238 (197 added, 17 deleted, 24 changed)
Diffstat (limited to 'AppKit/GTMFadeTruncatingTextFieldCell.h')
-rw-r--r--AppKit/GTMFadeTruncatingTextFieldCell.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/AppKit/GTMFadeTruncatingTextFieldCell.h b/AppKit/GTMFadeTruncatingTextFieldCell.h
index 76e7b1c..267d4b8 100644
--- a/AppKit/GTMFadeTruncatingTextFieldCell.h
+++ b/AppKit/GTMFadeTruncatingTextFieldCell.h
@@ -21,8 +21,26 @@
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
-// A simple text field cell that truncates the right hand edge using a gradient
-@interface GTMFadeTruncatingTextFieldCell : NSTextFieldCell
+typedef enum {
+ GTMFadeTruncatingTail,
+ GTMFadeTruncatingHead,
+ GTMFadeTruncatingHeadAndTail,
+} GTMFadeTruncateMode;
+
+// A simple text field cell that can truncate at the beginning or the end
+// using a gradient. By default it truncates the end.
+@interface GTMFadeTruncatingTextFieldCell : NSTextFieldCell {
+ @private
+ NSUInteger desiredCharactersToTruncateFromHead_;
+ GTMFadeTruncateMode truncateMode_;
+}
+
+@property (nonatomic) GTMFadeTruncateMode truncateMode;
+
+// When truncating the head this specifies the maximum number of characters
+// that can be truncated. Setting this to 0 means that there is no maximum.
+@property (nonatomic) NSUInteger desiredCharactersToTruncateFromHead;
+
@end
#endif