From 5299cb1da115859d120a7e7884adeffba21f2d30 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 11 Jan 2008 05:21:28 +0000 Subject: [PATCH] modify double-click code to differentiate Tiger and Leopard --- macosx/TorrentTableView.m | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 26e532234..b0fb82e19 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -128,7 +128,8 @@ [super mouseDown: event]; - if ([event clickCount] == 2 && !NSEqualPoints(fClickPoint, NSZeroPoint)) + //acts as if mouseUp: + if ([NSApp isOnLeopardOrBetter] && [event clickCount] == 2 && !NSEqualPoints(fClickPoint, NSZeroPoint)) { if ([self pointInProgressRect: fClickPoint]) { @@ -145,6 +146,7 @@ } } +//only applies for paths in mouseDown: where the super mouseDown: isn't called - (void) mouseUp: (NSEvent *) event { int oldRow; @@ -174,12 +176,28 @@ [[fTorrents objectAtIndex: row] revealData]; else; } + else if (![NSApp isOnLeopardOrBetter] && [event clickCount] == 2 && !NSEqualPoints(fClickPoint, NSZeroPoint)) + { + NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil]; + int row = [self rowAtPoint: point]; + + if ([self pointInProgressRect: fClickPoint]) + { + [fDefaults setBool: ![fDefaults boolForKey: @"DisplayStatusProgressSelected"] forKey: @"DisplayStatusProgressSelected"]; + [self reloadData]; + } + else if ([self pointInIconRect: point]) + [[fTorrents objectAtIndex: row] revealData]; + else if (![self pointInActionRect: point]) + [fController showInfo: nil]; + else; + } + else; [super mouseUp: event]; fClickPoint = NSZeroPoint; - #warning need fClickIn? BOOL wasClickIn = fClickIn; fClickIn = NO;