mirror of
https://github.com/transmission/transmission
synced 2025-02-04 13:32:19 +00:00
no need to have the bitmap as an instance variable since it is no longer saving colors between reload
This commit is contained in:
parent
cd886da2ac
commit
510570091c
2 changed files with 8 additions and 14 deletions
|
@ -39,8 +39,6 @@
|
|||
* fGreenGradient, * fLightGreenGradient, * fDarkGreenGradient, * fYellowGradient, * fRedGradient;
|
||||
|
||||
NSColor * fGrayColor, * fBlueColor, * fBlue1Color, * fBlue2Color, * fBlue3Color, * fBlue4Color, * fOrangeColor;
|
||||
|
||||
NSBitmapImageRep * fBitmap;
|
||||
}
|
||||
|
||||
- (NSRect) iconRectForBounds: (NSRect) bounds;
|
||||
|
|
|
@ -115,8 +115,6 @@
|
|||
{
|
||||
TorrentCell * copy = [super copyWithZone: zone];
|
||||
|
||||
copy->fBitmap = nil;
|
||||
|
||||
copy->fGrayGradient = [fGrayGradient retain];
|
||||
copy->fLightGrayGradient = [fLightGrayGradient retain];
|
||||
copy->fBlueGradient = [fBlueGradient retain];
|
||||
|
@ -132,8 +130,6 @@
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
[fBitmap release];
|
||||
|
||||
[fGrayGradient release];
|
||||
[fLightGrayGradient release];
|
||||
[fBlueGradient release];
|
||||
|
@ -591,8 +587,6 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
[fBitmap release];
|
||||
fBitmap = nil;
|
||||
[[self representedObject] setPreviousAmountFinished: NULL];
|
||||
|
||||
[self drawRegularBar: barRect];
|
||||
|
@ -736,8 +730,7 @@
|
|||
|
||||
- (void) drawPiecesBar: (NSRect) barRect
|
||||
{
|
||||
if (!fBitmap)
|
||||
fBitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: nil
|
||||
NSBitmapImageRep * bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: nil
|
||||
pixelsWide: MAX_PIECES pixelsHigh: 1 bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES
|
||||
isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace bytesPerRow: 0 bitsPerPixel: 0];
|
||||
|
||||
|
@ -773,13 +766,16 @@
|
|||
pieceColor = fBlue4Color;
|
||||
|
||||
//it's faster to just set color instead of checking previous color
|
||||
[fBitmap setColor: pieceColor atX: i y: 0];
|
||||
[bitmap setColor: pieceColor atX: i y: 0];
|
||||
}
|
||||
|
||||
[torrent setPreviousAmountFinished: piecePercent];
|
||||
|
||||
//actually draw image
|
||||
[fBitmap drawInRect: barRect];
|
||||
[bitmap drawInRect: barRect];
|
||||
|
||||
[bitmap release];
|
||||
bitmap = nil;
|
||||
}
|
||||
|
||||
- (NSRect) rectForMinimalStatusWithString: (NSAttributedString *) string inBounds: (NSRect) bounds
|
||||
|
|
Loading…
Reference in a new issue