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
{return YES;
{
return fStat->error != 0;
}

View File

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

View File

@ -507,18 +507,10 @@
int row = [self rowAtPoint: point];
if (row < 0 || ![fDefaults boolForKey: @"SmallView"])
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;
NSRect cellRect = [self frameOfCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: row];
NSRect statusRect = NSMakeRect(NSMaxX(cellRect) - statusWidth, cellRect.origin.y,
statusWidth, cellRect.size.height - BUTTON_WIDTH);
return NSPointInRect(point, statusRect);
TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
[cell setRepresentedObject: [fTorrents objectAtIndex: row]];
return NSPointInRect(point, [cell minimalStatusRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
}
- (BOOL) pointInPauseRect: (NSPoint) point