didn't mean to commit some experimental, nonworking code; also, only create the string attributes when needed

This commit is contained in:
Mitchell Livingston
2007-09-28 12:58:31 +00:00
parent 6a976eed1c
commit f5bd7f17ce
3 changed files with 6 additions and 5 deletions

View File

@@ -27,6 +27,7 @@
@interface PeerProgressIndicatorCell : NSLevelIndicatorCell
{
BOOL fIsHidden;
NSDictionary * fAttributes;
NSImage * fCheckImage;
}

View File

@@ -45,9 +45,9 @@
NSMutableParagraphStyle *centeredStyle = [[[NSMutableParagraphStyle alloc] init] autorelease];
[centeredStyle setAlignment:NSCenterTextAlignment];
[[NSString stringWithFormat: @"%.1f%%", [self floatValue] * 100.0] drawInRect: cellFrame
withAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
[NSFont systemFontOfSize: 11.0], NSFontAttributeName, nil]];
if (!fAttributes)
fAttributes = [NSDictionary dictionaryWithObject: [NSFont systemFontOfSize: 11.0] forKey: NSFontAttributeName];
[[NSString stringWithFormat: @"%.1f%%", [self floatValue] * 100.0] drawInRect: cellFrame withAttributes: fAttributes];
}
else
{

View File

@@ -270,7 +270,7 @@
if (rightWidth > 0)
{
if (![fDefaults boolForKey: @"DisplayProgressBarAvailable"])
/*if (![fDefaults boolForKey: @"DisplayProgressBarAvailable"])
{
int notAvailableWidth = barRect.size.width * [torrent notAvailableDesired];
//NSLog(@"notAvailableWidth %d rightWidth %d", notAvailableWidth, rightWidth);
@@ -288,7 +288,7 @@
fYellowGradient = [[CTGradient progressYellowGradient] retain];
[fYellowGradient fillRect: notAvailableRect angle: -90];
}
}
}*/
if (rightWidth > 0)
{