1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-01 03:43:43 +00:00

small adjustments to TorrentCell

This commit is contained in:
Mitchell Livingston 2007-08-14 03:59:47 +00:00
parent b63ddf0676
commit 067afdf926
2 changed files with 17 additions and 13 deletions

View file

@ -26,13 +26,14 @@
@interface TorrentCell : NSCell @interface TorrentCell : NSCell
{ {
NSImage * fErrorImage;
CTGradient * fWhiteGradient, * fGrayGradient, * fLightGrayGradient, * fBlueGradient, * fDarkBlueGradient,
* fGreenGradient, * fLightGreenGradient, * fDarkGreenGradient, * fYellowGradient, * fTransparentGradient;
NSUserDefaults * fDefaults; NSUserDefaults * fDefaults;
NSImage * fErrorImage;
NSMutableDictionary * fTitleAttributes, * fStatusAttributes; NSMutableDictionary * fTitleAttributes, * fStatusAttributes;
NSColor * fBarOverlayColor;
CTGradient * fWhiteGradient, * fGrayGradient, * fLightGrayGradient, * fBlueGradient, * fDarkBlueGradient,
* fGreenGradient, * fLightGreenGradient, * fDarkGreenGradient, * fYellowGradient, * fTransparentGradient;
NSBitmapImageRep * fBitmap; NSBitmapImageRep * fBitmap;
int8_t * fPieces; int8_t * fPieces;
} }

View file

@ -92,13 +92,14 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
[paragraphStyle setLineBreakMode: NSLineBreakByTruncatingTail]; [paragraphStyle setLineBreakMode: NSLineBreakByTruncatingTail];
fTitleAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys: fTitleAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
[NSFont messageFontOfSize: 12.0], NSFontAttributeName, [NSFont messageFontOfSize: 12.0], NSFontAttributeName,
paragraphStyle, NSParagraphStyleAttributeName, nil]; paragraphStyle, NSParagraphStyleAttributeName, nil];
fStatusAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys: fStatusAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
[NSFont messageFontOfSize: 9.0], NSFontAttributeName, [NSFont messageFontOfSize: 9.0], NSFontAttributeName,
paragraphStyle, NSParagraphStyleAttributeName, nil]; paragraphStyle, NSParagraphStyleAttributeName, nil];
[paragraphStyle release]; [paragraphStyle release];
fBarOverlayColor = [[NSColor colorWithDeviceWhite: 0.0 alpha: 0.2] retain];
} }
return self; return self;
} }
@ -109,6 +110,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
copy->fBitmap = nil; copy->fBitmap = nil;
copy->fPieces = NULL; copy->fPieces = NULL;
return copy;
} }
- (void) dealloc - (void) dealloc
@ -359,7 +362,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
} }
} }
[[NSColor colorWithDeviceWhite: 0.0 alpha: 0.2] set]; [fBarOverlayColor set];
[NSBezierPath strokeRect: NSInsetRect(NSMakeRect(0, 0, width, BAR_HEIGHT), 0.5, 0.5)]; [NSBezierPath strokeRect: NSInsetRect(NSMakeRect(0, 0, width, BAR_HEIGHT), 0.5, 0.5)];
[bar unlockFocus]; [bar unlockFocus];
@ -371,18 +374,18 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
{ {
NSImage * image = [self advancedBarSimple]; NSImage * image = [self advancedBarSimple];
NSRect barBounds = NSMakeRect(0, 0, width, BAR_HEIGHT);
[image setScalesWhenResized: YES]; [image setScalesWhenResized: YES];
[image setSize: NSMakeSize(width, BAR_HEIGHT)]; [image setSize: barBounds.size];
[image lockFocus]; [image lockFocus];
NSRect barBounds = NSMakeRect(0, 0, width, BAR_HEIGHT);
if (!fTransparentGradient) if (!fTransparentGradient)
fTransparentGradient = [[CTGradient progressTransparentGradient] retain]; fTransparentGradient = [[CTGradient progressTransparentGradient] retain];
[fTransparentGradient fillRect: barBounds angle: 90]; [fTransparentGradient fillRect: barBounds angle: 90];
[[NSColor colorWithDeviceWhite: 0.0 alpha: 0.2] set]; [fBarOverlayColor set];
[NSBezierPath strokeRect: NSInsetRect(barBounds, 0.5, 0.5)]; [NSBezierPath strokeRect: NSInsetRect(barBounds, 0.5, 0.5)];
[image unlockFocus]; [image unlockFocus];