Commit 82db99a4 authored by David Fuhrmann's avatar David Fuhrmann

macosx: show reveal-in-finder menu replacement at a similar position as the original one

parent ceb372ef
...@@ -474,7 +474,7 @@ ...@@ -474,7 +474,7 @@
[contextMenu release]; [contextMenu release];
NSURL * representedURL = [[self window] representedURL]; NSURL * representedURL = [[self window] representedURL];
if (! representedURL) if (!representedURL)
return; return;
NSArray * pathComponents; NSArray * pathComponents;
...@@ -527,7 +527,31 @@ ...@@ -527,7 +527,31 @@
[currentItem setImage: icon]; [currentItem setImage: icon];
[currentItem setTarget: self]; [currentItem setTarget: self];
[NSMenu popUpContextMenu: contextMenu withEvent: o_event forView: [self superview]]; // center the context menu similar to the white interface
CGFloat menuWidth = [contextMenu size].width;
NSRect windowFrame = [[self window] frame];
NSPoint point;
CGFloat fullButtonWidth = 0.;
if([[VLCMain sharedInstance] nativeFullscreenMode])
fullButtonWidth = 20.;
// assumes 60 px for the window buttons
point.x = (windowFrame.size.width - 60. - fullButtonWidth) / 2. - menuWidth / 2. + 60. - 20.;
point.y = windowFrame.size.height + 1.;
if (point.x < 0)
point.x = 10;
NSEvent *fakeMouseEvent = [NSEvent mouseEventWithType:NSRightMouseDown
location:point
modifierFlags:0
timestamp:0
windowNumber:[[self window] windowNumber]
context:nil
eventNumber:0
clickCount:0
pressure:0];
[NSMenu popUpContextMenu: contextMenu withEvent: fakeMouseEvent forView: [self superview]];
} }
- (IBAction)revealInFinder:(id)sender - (IBAction)revealInFinder:(id)sender
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment