Changeset 2721


Ignore:
Timestamp:
Aug 11, 2007, 3:09:31 AM (15 years ago)
Author:
livings124
Message:

get the icon placement from TorrentCell? instead of generating it in the tableview

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.h

    r2718 r2721  
    3838}
    3939
    40 - (NSRect) imageRectForBounds: (NSRect) bounds;
     40- (NSRect) iconRectForBounds: (NSRect) bounds;
    4141- (NSRect) titleRectForBounds: (NSRect) bounds;
    4242- (NSRect) progressRectForBounds: (NSRect) bounds;
  • trunk/macosx/TorrentCell.m

    r2717 r2721  
    116116}
    117117
    118 - (NSRect) imageRectForBounds: (NSRect) bounds
     118- (NSRect) iconRectForBounds: (NSRect) bounds
    119119{
    120120    NSRect result = bounds;
     
    193193    //icon
    194194    NSImage * icon = minimal ? (error ? fErrorImage : [torrent iconSmall]) : [torrent iconFlipped];
    195     NSRect iconRect = [self imageRectForBounds: cellFrame];
     195    NSRect iconRect = [self iconRectForBounds: cellFrame];
    196196    [icon drawInRect: iconRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
    197197   
  • trunk/macosx/TorrentTableView.m

    r2720 r2721  
    3434
    3535@interface TorrentTableView (Private)
    36 
    37 - (NSRect) iconRectForRow: (int) row;
    3836
    3937- (NSRect) pauseRectForRow: (int) row;
     
    488486- (NSRect) actionRectForRow: (int) row
    489487{
    490     if ([fDefaults boolForKey: @"SmallView"])
    491         return [self iconRectForRow: row];
    492     else if (row < 0)
     488    if (row < 0)
    493489        return NSZeroRect;
     490    else if ([fDefaults boolForKey: @"SmallView"])
     491    {
     492        TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
     493        return [cell iconRectForBounds: [self frameOfCellAtColumn: 0 row: row]];
     494    }
    494495    else;
    495496   
     
    507508        return NO;
    508509   
    509     return NSPointInRect(point, [self iconRectForRow: row]);
     510    TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
     511    return NSPointInRect(point, [cell iconRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
    510512}
    511513
Note: See TracChangeset for help on using the changeset viewer.