modify double-click code to differentiate Tiger and Leopard

This commit is contained in:
Mitchell Livingston 2008-01-11 05:21:28 +00:00
parent 4a6c14bc01
commit 5299cb1da1
1 changed files with 20 additions and 2 deletions

View File

@ -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;