on 10.5 use the function to get a prepared cell instead of making one manually

This commit is contained in:
Mitchell Livingston 2008-01-12 05:09:03 +00:00
parent c77d03c040
commit 59d0ce9d33
2 changed files with 18 additions and 14 deletions

View File

@ -30,15 +30,6 @@
@implementation FileOutlineView
- (id) initWithCoder: (NSCoder *) coder
{
if ((self = [super initWithCoder: coder]))
{
fMouseRow = -1;
}
return self;
}
- (void) awakeFromNib
{
FileNameCell * nameCell = [[FileNameCell alloc] init];
@ -63,6 +54,8 @@
endingColor = [NSColor colorWithCalibratedRed: 225.0/255.0 green: 218.0/255.0 blue: 255.0/255.0 alpha: 1.0];
beginningColor = [endingColor blendedColorWithFraction: 0.3 ofColor: [NSColor whiteColor]];
fMixedPriorityGradient = [[CTGradient gradientWithBeginningColor: beginningColor endingColor: endingColor] retain];
fMouseRow = -1;
}
- (void) dealloc
@ -122,7 +115,6 @@
return;
int col = [self columnWithIdentifier: @"Priority"];
NSTrackingAreaOptions options = NSTrackingEnabledDuringMouseDrag | NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways;
NSPoint mouseLocation = [self convertPoint: [[self window] convertScreenToBase: [NSEvent mouseLocation]] fromView: nil];
int row;

View File

@ -644,8 +644,14 @@
if (row < 0 || [fDefaults boolForKey: @"SmallView"])
return NO;
TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
[cell setRepresentedObject: [fTorrents objectAtIndex: row]];
TorrentCell * cell;
if ([NSApp isOnLeopardOrBetter])
cell = (TorrentCell * )[self preparedCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: row];
else
{
cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
[cell setRepresentedObject: [fTorrents objectAtIndex: row]];
}
return NSPointInRect(point, [cell progressRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
}
@ -655,8 +661,14 @@
if (row < 0 || ![fDefaults boolForKey: @"SmallView"])
return NO;
TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
[cell setRepresentedObject: [fTorrents objectAtIndex: row]];
TorrentCell * cell;
if ([NSApp isOnLeopardOrBetter])
cell = (TorrentCell * )[self preparedCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: row];
else
{
cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
[cell setRepresentedObject: [fTorrents objectAtIndex: row]];
}
return NSPointInRect(point, [cell minimalStatusRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
}