From 87147ad2bee79aa5a79028d8bbc045a694b427cf Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 11 Aug 2007 02:33:10 +0000 Subject: [PATCH] get the minimal status to toggle based on the new cell method, and fix silly test code that made the error icon always show --- macosx/Torrent.m | 2 +- macosx/TorrentCell.h | 2 +- macosx/TorrentTableView.m | 14 +++----------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/macosx/Torrent.m b/macosx/Torrent.m index cb7769cfe..ccaac53e6 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1004,7 +1004,7 @@ static int static_lastid = 0; } - (BOOL) isError -{return YES; +{ return fStat->error != 0; } diff --git a/macosx/TorrentCell.h b/macosx/TorrentCell.h index 030c50e51..f8609ae24 100644 --- a/macosx/TorrentCell.h +++ b/macosx/TorrentCell.h @@ -22,7 +22,7 @@ * DEALINGS IN THE SOFTWARE. *****************************************************************************/ -#import "CTGradient.h" +@class CTGradient; @interface TorrentCell : NSCell { diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 2d1a78571..b83533629 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -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