From 5cadf77481727a70f7cf7925e641e9a46f546ed6 Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Mon, 23 Nov 2009 19:05:18 +0000 Subject: [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) --- AppKit/GTMFadeTruncatingTextFieldCellTest.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'AppKit/GTMFadeTruncatingTextFieldCellTest.m') 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 -- cgit v1.2.3