aboutsummaryrefslogtreecommitdiff
path: root/AppKit
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2011-08-08 22:00:30 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2011-08-08 22:00:30 +0000
commit3393cede4ab318e20d8549c72f93b9f8d7d3a41a (patch)
tree96286c36f2b3494db5ff8596e4347e48a1fd6274 /AppKit
parent007d321035108ad2cffb1785da20a3d04650b5c6 (diff)
[Author: avi]
Switch to using the class methods +saveGraphicsState/+restoreGraphicsState. R=mmentovai APPROVED=dmaclach
Diffstat (limited to 'AppKit')
-rw-r--r--AppKit/GTMFadeTruncatingTextFieldCell.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/AppKit/GTMFadeTruncatingTextFieldCell.m b/AppKit/GTMFadeTruncatingTextFieldCell.m
index 66e6874..ebe4dd0 100644
--- a/AppKit/GTMFadeTruncatingTextFieldCell.m
+++ b/AppKit/GTMFadeTruncatingTextFieldCell.m
@@ -42,7 +42,7 @@
fadeToRight:(BOOL)fadeToRight {
// Draw the gradient part with a transparency layer. This makes the text look
// suboptimal, but since it fades out, that's ok.
- [[NSGraphicsContext currentContext] saveGraphicsState];
+ [NSGraphicsContext saveGraphicsState];
[NSBezierPath clipRect:backgroundRect];
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
CGContextBeginTransparencyLayerWithRect(context,
@@ -54,10 +54,10 @@
NSCompositeSourceOver);
}
- [[NSGraphicsContext currentContext] saveGraphicsState];
+ [NSGraphicsContext saveGraphicsState];
[NSBezierPath clipRect:clipRect];
[attributedString drawInRect:titleRect];
- [[NSGraphicsContext currentContext] restoreGraphicsState];
+ [NSGraphicsContext restoreGraphicsState];
NSPoint startPoint;
NSPoint endPoint;
@@ -77,7 +77,7 @@
NSGradientDrawsAfterEndingLocation];
CGContextEndTransparencyLayer(context);
- [[NSGraphicsContext currentContext] restoreGraphicsState];
+ [NSGraphicsContext restoreGraphicsState];
}
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
@@ -171,7 +171,7 @@
// Draw non-gradient part without transparency layer, as light text on a dark
// background looks bad with a gradient layer.
- [[NSGraphicsContext currentContext] saveGraphicsState];
+ [NSGraphicsContext saveGraphicsState];
if ([self drawsBackground]) {
[[self backgroundColor] set];
NSRectFillUsingOperation(solidBackgroundPart, NSCompositeSourceOver);
@@ -180,7 +180,7 @@
// doesn't draw correctly if the cell draws its own background.
[NSBezierPath clipRect:solidTitleClipPart];
[attributedString drawInRect:offsetTitleRect];
- [[NSGraphicsContext currentContext] restoreGraphicsState];
+ [NSGraphicsContext restoreGraphicsState];
NSColor *startColor = [self textColor];;
NSColor *endColor = [startColor colorWithAlphaComponent:0.0];