mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
keep one image for the table view instead of one for regular and one for minimal
This commit is contained in:
@@ -311,7 +311,10 @@
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
free(showAvailablity ? pieces : piecesPercent);
|
||||
if (showAvailablity)
|
||||
free(pieces);
|
||||
else
|
||||
free(piecesPercent);
|
||||
}
|
||||
|
||||
- (BOOL) acceptsFirstMouse: (NSEvent *) event
|
||||
|
||||
@@ -56,7 +56,7 @@ typedef enum
|
||||
|
||||
NSUserDefaults * fDefaults;
|
||||
|
||||
NSImage * fIcon, * fIconFlipped, * fIconSmall;
|
||||
NSImage * fIcon, * fIconFlipped;
|
||||
NSMutableString * fNameString, * fProgressString, * fStatusString, * fShortStatusString, * fRemainingTimeString;
|
||||
|
||||
tr_file_stat_t * fileStat;
|
||||
@@ -130,7 +130,6 @@ typedef enum
|
||||
|
||||
- (NSImage *) icon;
|
||||
- (NSImage *) iconFlipped;
|
||||
- (NSImage *) iconSmall;
|
||||
|
||||
- (NSString *) name;
|
||||
- (uint64_t) size;
|
||||
|
||||
@@ -157,7 +157,6 @@ static int static_lastid = 0;
|
||||
|
||||
[fIcon release];
|
||||
[fIconFlipped release];
|
||||
[fIconSmall release];
|
||||
|
||||
[fProgressString release];
|
||||
[fStatusString release];
|
||||
@@ -832,18 +831,6 @@ static int static_lastid = 0;
|
||||
return fIconFlipped;
|
||||
}
|
||||
|
||||
- (NSImage *) iconSmall
|
||||
{
|
||||
if (!fIconSmall)
|
||||
{
|
||||
fIconSmall = [fIcon copy];
|
||||
[fIconSmall setFlipped: YES];
|
||||
[fIconSmall setScalesWhenResized: YES];
|
||||
[fIconSmall setSize: NSMakeSize(16.0, 16.0)];
|
||||
}
|
||||
return fIconSmall;
|
||||
}
|
||||
|
||||
- (NSString *) name
|
||||
{
|
||||
return [NSString stringWithUTF8String: fInfo->name];
|
||||
|
||||
@@ -209,7 +209,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||
}
|
||||
|
||||
//icon
|
||||
NSImage * icon = minimal ? (error ? fErrorImage : [torrent iconSmall]) : [torrent iconFlipped];
|
||||
NSImage * icon = minimal && error ? fErrorImage : [torrent iconFlipped];
|
||||
NSRect iconRect = [self iconRectForBounds: cellFrame];
|
||||
[icon drawInRect: iconRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@
|
||||
if (row < 0)
|
||||
return NSZeroRect;
|
||||
|
||||
NSRect cellRect = [self frameOfCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: row];
|
||||
NSRect cellRect = [self frameOfCellAtColumn: 0 row: row];
|
||||
|
||||
float buttonToTop = [fDefaults boolForKey: @"SmallView"] ? BUTTON_TO_TOP_SMALL : BUTTON_TO_TOP_REGULAR;
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
if (row < 0)
|
||||
return NSZeroRect;
|
||||
|
||||
NSRect cellRect = [self frameOfCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: row];
|
||||
NSRect cellRect = [self frameOfCellAtColumn: 0 row: row];
|
||||
|
||||
float buttonToTop = [fDefaults boolForKey: @"SmallView"] ? BUTTON_TO_TOP_SMALL : BUTTON_TO_TOP_REGULAR;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user