mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Fix popup positioning.
This commit is contained in:
parent
266ec7e430
commit
22c1897eee
2 changed files with 10 additions and 6 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue