aboutsummaryrefslogtreecommitdiff
path: root/AppKit/GTMFadeTruncatingTextFieldCellTest.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2011-03-28 19:00:23 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2011-03-28 19:00:23 +0000
commit09c3d1d4c6cc035acec7578eeb0ba0bae228fcb0 (patch)
tree153f54808206929703e87ec57e6f13abe31702cd /AppKit/GTMFadeTruncatingTextFieldCellTest.m
parent49488762da466f2515d55e0547a8e15aa7560ebe (diff)
[Author: sail]
Tweak fade effect for GTMFadeTruncatingTextFieldCell This change tweaks how we fade the beginning of the text in GTMFadeTruncatingTextFieldCell. Previously we would start drawing the string at the desired position. This meant that the first character was not legible because of the fade effect. With this change we now start drawing a few pixels before the desired position. I also fixed a bug in how we draw the background of the cell. Previously we clipped to the text rect before drawing the background. When the text field had a border this meant that we weren't drawing all of the background because the text rect is slightly smaller than the background rect. With this change we now draw the background rect before setting the text rect clip. R=thomasvl,dmaclach APPROVED=dmaclach DELTA=81 (51 added, 2 deleted, 28 changed)
Diffstat (limited to 'AppKit/GTMFadeTruncatingTextFieldCellTest.m')
-rw-r--r--AppKit/GTMFadeTruncatingTextFieldCellTest.m11
1 files changed, 10 insertions, 1 deletions
diff --git a/AppKit/GTMFadeTruncatingTextFieldCellTest.m b/AppKit/GTMFadeTruncatingTextFieldCellTest.m
index a1bf937..c201d27 100644
--- a/AppKit/GTMFadeTruncatingTextFieldCellTest.m
+++ b/AppKit/GTMFadeTruncatingTextFieldCellTest.m
@@ -75,7 +75,7 @@
@"GTMFadeTruncatingTextFieldCellTest5",
nil);
- [field setStringValue:@"Fade on left only AA"];
+ [field setStringValue:@"Fade on left only A"];
GTMAssertObjectImageEqualToImageNamed(field,
@"GTMFadeTruncatingTextFieldCellTest6",
nil);
@@ -92,6 +92,15 @@
GTMAssertObjectImageEqualToImageNamed(field,
@"GTMFadeTruncatingTextFieldCellTest7",
nil);
+
+ // Border with a solid background color.
+ [field setTextColor:[NSColor whiteColor]];
+ [field setDrawsBackground:YES];
+ [field setBackgroundColor:[NSColor blackColor]];
+ [field setBordered:YES];
+ GTMAssertObjectImageEqualToImageNamed(field,
+ @"GTMFadeTruncatingTextFieldCellTest8",
+ nil);
}
@end