diff --git a/macosx/TorrentCell.h b/macosx/TorrentCell.h index b4bd231fa..dc5c1e561 100644 --- a/macosx/TorrentCell.h +++ b/macosx/TorrentCell.h @@ -56,8 +56,6 @@ - (void) addTrackingAreasForView: (NSView *) controlView inRect: (NSRect) cellFrame withUserInfo: (NSDictionary *) userInfo mouseLocation: (NSPoint) mouseLocation; -/*- (void) mouseEntered: (NSEvent *) event; -- (void) mouseExited: (NSEvent *) event;*/ - (void) setControlHover: (BOOL) hover; - (void) setRevealHover: (BOOL) hover; diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index 5288e7295..72fb75c32 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -388,26 +388,6 @@ [area release]; } -/*- (void) mouseEntered: (NSEvent *) event -{ - NSDictionary * userInfo = [event userData]; - - if ([[userInfo objectForKey: @"Type"] isEqualToString: @"Control"]) - fHoverControl = YES; - else - fHoverReveal = YES; - - [(NSControl *)[self controlView] updateCell: self]; -} - -- (void) mouseExited: (NSEvent *) event -{ - fHoverControl = NO; - fHoverReveal = NO; - - [(NSControl *)[self controlView] updateCell: self]; -}*/ - - (void) setControlHover: (BOOL) hover { fHoverControl = hover; diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 110ebd2cc..281edf7d8 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -65,7 +65,6 @@ - (void) dealloc { - //[fMouseCell release]; [fSelectedIndexes release]; [fKeyStrokes release]; @@ -129,19 +128,6 @@ if ((row = [dict objectForKey: @"Row"])) { int rowVal = [row intValue]; - /*TorrentCell * cell = (TorrentCell *)[self preparedCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: rowVal]; - if (fMouseCell != cell) - { - [fMouseCell release]; - - fMouseRow = rowVal; - fMouseCell = [cell copy]; - - [fMouseCell setRepresentedObject: [fTorrents objectAtIndex: rowVal]]; - [fMouseCell setControlView: self]; - [fMouseCell mouseEntered: event]; - }*/ - if ([[dict objectForKey: @"Type"] isEqualToString: @"Control"]) fMouseControlRow = rowVal; else @@ -156,15 +142,6 @@ NSNumber * row; if ((row = [(NSDictionary *)[event userData] objectForKey: @"Row"])) { - /*TorrentCell * cell = (TorrentCell *)[self preparedCellAtColumn: [self columnWithIdentifier: @"Torrent"] - row: [row intValue]]; - [cell setControlView: self]; - [cell mouseExited: event]; - - [fMouseCell release]; - fMouseCell = nil; - fMouseRow = -1;*/ - fMouseControlRow = -1; fMouseRevealRow = -1; @@ -172,22 +149,6 @@ } } -/*- (NSCell *) preparedCellAtColumn: (NSInteger) column row: (NSInteger) row -{ - if (![self selectedCell] && row == fMouseRow && column == [self columnWithIdentifier: @"Torrent"]) - return fMouseCell; - else - return [super preparedCellAtColumn: column row: row]; -} - -- (void) updateCell: (NSCell *) cell -{ - if (cell == fMouseCell) - [self setNeedsDisplayInRect: [self frameOfCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: fMouseRow]]; - else - [super updateCell: cell]; -}*/ - - (void) tableViewSelectionIsChanging: (NSNotification *) notification { if (fSelectedIndexes) @@ -224,7 +185,6 @@ [self reloadData]; } - //acts as if mouseUp: if ([NSApp isOnLeopardOrBetter] && [event clickCount] == 2) { if ([self pointInProgressRect: point]) @@ -348,18 +308,18 @@ } #warning get rect to actually change -/*- (NSString *) tableView: (NSTableView *) tableView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect +- (NSString *) tableView: (NSTableView *) tableView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect tableColumn: (NSTableColumn *) tableColumn row: (NSInteger) row mouseLocation: (NSPoint) mousePoint { if ([self pointInActionRect: mousePoint]) { - *rect = [self actionRectForRow: row]; + *rect = [(TorrentCell *)cell actionButtonRectForBounds: [self frameOfCellAtColumn: 0 row: row]]; return NSLocalizedString(@"Shortcuts for changing transfer settings.", "Torrent Table -> tooltip"); } - else if ([self pointInPauseRect: mousePoint]) + else if ([self pointInControlRect: mousePoint]) { - *rect = [self pauseRectForRow: row]; + *rect = *rect = [(TorrentCell *)cell controlButtonRectForBounds: [self frameOfCellAtColumn: 0 row: row]]; Torrent * torrent = [fTorrents objectAtIndex: row]; if ([torrent isActive]) @@ -376,13 +336,13 @@ } else if ([self pointInRevealRect: mousePoint]) { - *rect = [self revealRectForRow: row]; + *rect = [(TorrentCell *)cell revealButtonRectForBounds: [self frameOfCellAtColumn: 0 row: row]]; return NSLocalizedString(@"Reveal the data file in Finder.", "Torrent Table -> tooltip"); } return nil; -}*/ +} - (void) toggleControlForTorrent: (Torrent *) torrent {