Fix popup positioning.

This commit is contained in:
Gregory John Casamento 2020-05-05 02:14:46 -04:00
parent 266ec7e430
commit 22c1897eee
2 changed files with 10 additions and 6 deletions

View file

@ -1630,12 +1630,16 @@ static BOOL menuBarVisible = YES;
atLocation: (NSPoint) point
inView: (NSView *) view
{
NSRect cellFrame = [view frame]; // NSMakeRect(point.x, point.y, 10.0, 10.0);
[[GSTheme theme] displayPopUpMenu: [self menuRepresentation]
NSRect cellFrame = [[view window] convertRectToScreen: [view frame]];
NSWindow *w = [view window];
NSMenuView *mr = [self menuRepresentation];
NSUInteger selectedItem = [self indexOfItem: item];
[[GSTheme theme] displayPopUpMenu: mr
withCellFrame: cellFrame
controlViewWindow: [NSApp mainWindow]
controlViewWindow: w
preferredEdge: NSMinYEdge
selectedItem: 0];
selectedItem: selectedItem];
}
/*

View file

@ -240,8 +240,6 @@
- (void) _doChooseMenuAction: (id)sender
{
NSOpenPanel *op = [NSOpenPanel openPanel];
NSArray *urls = [op URLs];
NSURL *url = [urls objectAtIndex: 0];
int result = 0;
[op setAllowsMultipleSelection: NO];
@ -253,6 +251,8 @@
types: nil];
if (result == NSOKButton)
{
NSArray *urls = [op URLs];
NSURL *url = [urls objectAtIndex: 0];
[self setURL: url];
}