Changeset 9478


Ignore:
Timestamp:
Nov 4, 2009, 3:00:49 AM (12 years ago)
Author:
livings124
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentTableView.m

    r9477 r9478  
    569569    NSPoint location = rect.origin;
    570570    location.y += rect.size.height + 5.0f;
    571     location = [self convertPoint: location toView: nil];
    572    
    573     NSEvent * newEvent = [NSEvent mouseEventWithType: [event type] location: location
    574         modifierFlags: [event modifierFlags] timestamp: [event timestamp] windowNumber: [event windowNumber]
    575         context: [event context] eventNumber: [event eventNumber] clickCount: [event clickCount] pressure: [event pressure]];
    576    
    577     [NSMenu popUpContextMenu: fActionMenu withEvent: newEvent forView: self];
     571   
     572    if ([NSApp isOnSnowLeopardOrBetter])
     573    {
     574        location = [self convertPoint: location toView: self];
     575        [fActionMenu popUpMenuPositioningItem: nil atLocation: location inView: self];
     576    }
     577    else
     578    {
     579        location = [self convertPoint: location toView: nil];
     580        NSEvent * newEvent = [NSEvent mouseEventWithType: [event type] location: location
     581            modifierFlags: [event modifierFlags] timestamp: [event timestamp] windowNumber: [event windowNumber]
     582            context: [event context] eventNumber: [event eventNumber] clickCount: [event clickCount] pressure: [event pressure]];
     583       
     584        [NSMenu popUpContextMenu: fActionMenu withEvent: newEvent forView: self];
     585    }
    578586   
    579587    for (NSInteger i = [fActionMenu numberOfItems]-1; i >= numberOfNonFileItems; i--)
Note: See TracChangeset for help on using the changeset viewer.