aboutsummaryrefslogtreecommitdiff
path: root/AppKit/GTMFadeTruncatingTextFieldCellTest.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-11-23 19:05:18 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-11-23 19:05:18 +0000
commit5cadf77481727a70f7cf7925e641e9a46f546ed6 (patch)
tree0c6648fd40724d78a0e24168427515553a37108f /AppKit/GTMFadeTruncatingTextFieldCellTest.m
parentd8db7440acd54abce429f06ed0600081eac53b28 (diff)
[Author: thomasvl]
Nicer drawing of text by not using the gradient where it isn't needed, helps where light text is drawn on a dark background. Patch from thakis - http://codereview.appspot.com/159060/show R=thakis,dmaclach DELTA=79 (54 added, 7 deleted, 18 changed)
Diffstat (limited to 'AppKit/GTMFadeTruncatingTextFieldCellTest.m')
-rw-r--r--AppKit/GTMFadeTruncatingTextFieldCellTest.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/AppKit/GTMFadeTruncatingTextFieldCellTest.m b/AppKit/GTMFadeTruncatingTextFieldCellTest.m
index d3f328f..5957269 100644
--- a/AppKit/GTMFadeTruncatingTextFieldCellTest.m
+++ b/AppKit/GTMFadeTruncatingTextFieldCellTest.m
@@ -31,6 +31,7 @@
NSMakeRect(0, 0, 100, 16)] autorelease];
[field setCell:[[[GTMFadeTruncatingTextFieldCell alloc] initTextCell:@""]
autorelease]];
+
[field setStringValue:@"A very long string that won't fit"];
GTMAssertObjectImageEqualToImageNamed(field,
@"GTMFadeTruncatingTextFieldCellTest1",
@@ -39,6 +40,22 @@
GTMAssertObjectImageEqualToImageNamed(field,
@"GTMFadeTruncatingTextFieldCellTest2",
nil);
+
+ // Dark background, light text (force the background to draw (which is odd
+ // for a text cell), but this is to make sure the support for light on dark
+ // is tested.
+ [field setTextColor:[NSColor whiteColor]];
+ [field setDrawsBackground:YES];
+ [field setBackgroundColor:[NSColor blackColor]];
+
+ [field setStringValue:@"A very long string that won't fit"];
+ GTMAssertObjectImageEqualToImageNamed(field,
+ @"GTMFadeTruncatingTextFieldCellTest3",
+ nil);
+ [field setStringValue:@"A short string"];
+ GTMAssertObjectImageEqualToImageNamed(field,
+ @"GTMFadeTruncatingTextFieldCellTest4",
+ nil);
}
@end