get the minimal status to toggle based on the new cell method, and fix silly test code that made the error icon always show

This commit is contained in:
Mitchell Livingston 2007-08-11 02:33:10 +00:00
parent 963c8ae76f
commit 87147ad2be
3 changed files with 5 additions and 13 deletions

View File

@ -1004,7 +1004,7 @@ static int static_lastid = 0;
} }
- (BOOL) isError - (BOOL) isError
{return YES; {
return fStat->error != 0; return fStat->error != 0;
} }

View File

@ -22,7 +22,7 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*****************************************************************************/ *****************************************************************************/
#import "CTGradient.h" @class CTGradient;
@interface TorrentCell : NSCell @interface TorrentCell : NSCell
{ {

View File

@ -507,18 +507,10 @@
int row = [self rowAtPoint: point]; int row = [self rowAtPoint: point];
if (row < 0 || ![fDefaults boolForKey: @"SmallView"]) if (row < 0 || ![fDefaults boolForKey: @"SmallView"])
return NO; return NO;
Torrent * torrent = [fTorrents objectAtIndex: row];
NSString * statusString = ![fDefaults boolForKey: @"SmallStatusRegular"] && [torrent isActive]
? [torrent remainingTimeString] : [torrent shortStatusString];
float statusWidth = [statusString sizeWithAttributes: fSmallStatusAttributes].width + 3.0; TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
[cell setRepresentedObject: [fTorrents objectAtIndex: row]];
NSRect cellRect = [self frameOfCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: row]; return NSPointInRect(point, [cell minimalStatusRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
NSRect statusRect = NSMakeRect(NSMaxX(cellRect) - statusWidth, cellRect.origin.y,
statusWidth, cellRect.size.height - BUTTON_WIDTH);
return NSPointInRect(point, statusRect);
} }
- (BOOL) pointInPauseRect: (NSPoint) point - (BOOL) pointInPauseRect: (NSPoint) point