Changeset 2718


Ignore:
Timestamp:
Aug 11, 2007, 2:33:10 AM (15 years ago)
Author:
livings124
Message:

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

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r2715 r2718  
    10051005
    10061006- (BOOL) isError
    1007 {return YES;
     1007{
    10081008    return fStat->error != 0;
    10091009}
  • trunk/macosx/TorrentCell.h

    r2716 r2718  
    2323 *****************************************************************************/
    2424
    25 #import "CTGradient.h"
     25@class CTGradient;
    2626
    2727@interface TorrentCell : NSCell
  • trunk/macosx/TorrentTableView.m

    r2716 r2718  
    508508    if (row < 0 || ![fDefaults boolForKey: @"SmallView"])
    509509        return NO;
    510 
    511     Torrent * torrent = [fTorrents objectAtIndex: row];
    512     NSString * statusString = ![fDefaults boolForKey: @"SmallStatusRegular"] && [torrent isActive]
    513                                     ? [torrent remainingTimeString] : [torrent shortStatusString];
    514    
    515     float statusWidth = [statusString sizeWithAttributes: fSmallStatusAttributes].width + 3.0;
    516    
    517     NSRect cellRect = [self frameOfCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: row];
    518     NSRect statusRect = NSMakeRect(NSMaxX(cellRect) - statusWidth, cellRect.origin.y,
    519                                     statusWidth, cellRect.size.height - BUTTON_WIDTH);
    520    
    521     return NSPointInRect(point, statusRect);
     510   
     511    TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
     512    [cell setRepresentedObject: [fTorrents objectAtIndex: row]];
     513    return NSPointInRect(point, [cell minimalStatusRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
    522514}
    523515
Note: See TracChangeset for help on using the changeset viewer.