use a 10.6-method for displaying the per-torrent action menu

This commit is contained in:
Mitchell Livingston 2009-11-04 03:00:49 +00:00
parent 4df6e0e723
commit 4f1fd62cbf
1 changed files with 14 additions and 6 deletions

View File

@ -568,13 +568,21 @@
NSRect rect = [fTorrentCell iconRectForBounds: [self rectOfRow: row]];
NSPoint location = rect.origin;
location.y += rect.size.height + 5.0f;
location = [self convertPoint: location toView: nil];
NSEvent * newEvent = [NSEvent mouseEventWithType: [event type] location: location
modifierFlags: [event modifierFlags] timestamp: [event timestamp] windowNumber: [event windowNumber]
context: [event context] eventNumber: [event eventNumber] clickCount: [event clickCount] pressure: [event pressure]];
[NSMenu popUpContextMenu: fActionMenu withEvent: newEvent forView: self];
if ([NSApp isOnSnowLeopardOrBetter])
{
location = [self convertPoint: location toView: self];
[fActionMenu popUpMenuPositioningItem: nil atLocation: location inView: self];
}
else
{
location = [self convertPoint: location toView: nil];
NSEvent * newEvent = [NSEvent mouseEventWithType: [event type] location: location
modifierFlags: [event modifierFlags] timestamp: [event timestamp] windowNumber: [event windowNumber]
context: [event context] eventNumber: [event eventNumber] clickCount: [event clickCount] pressure: [event pressure]];
[NSMenu popUpContextMenu: fActionMenu withEvent: newEvent forView: self];
}
for (NSInteger i = [fActionMenu numberOfItems]-1; i >= numberOfNonFileItems; i--)
[fActionMenu removeItemAtIndex: i];