mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 13:10:38 +00:00
* Source/NSMenuView.m: In the method
- (void) setWindowFrameForAttachingToRect:... changed how popup/pulldown buttons handle the preferred edge. Per Cocoa documentation, the selected cell should always show up over the button for popups. For pull down menus, the preferred edge is relevant. This is also apparent from testing under Cocoa. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28189 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6addac1c7c
commit
6573b6c50f
2 changed files with 39 additions and 21 deletions
|
@ -1154,29 +1154,38 @@ static NSMapTable *viewInfo = 0;
|
|||
}
|
||||
|
||||
// Update position, if needed, using the preferredEdge
|
||||
if (edge == NSMinYEdge)
|
||||
if([_attachedMenu _ownedByPopUp])
|
||||
{
|
||||
/*
|
||||
if ([_attachedMenu _ownedByPopUp] &&
|
||||
([[_attachedMenu _owningPopUp] pullsDown]))
|
||||
{
|
||||
screenFrame.origin.y -= screenRect.size.height;
|
||||
}
|
||||
*/
|
||||
// Per Cocoa documentation, the selected cell should always show up
|
||||
// over the button for popups. For pull down menus, the preferred
|
||||
// edge is relevant. This is also apparent from testing under Cocoa.
|
||||
if([[_attachedMenu _owningPopUp] pullsDown])
|
||||
{
|
||||
if (edge == NSMinYEdge)
|
||||
{
|
||||
/*
|
||||
if ([_attachedMenu _ownedByPopUp] &&
|
||||
([[_attachedMenu _owningPopUp] pullsDown]))
|
||||
{
|
||||
screenFrame.origin.y -= screenRect.size.height;
|
||||
}
|
||||
*/
|
||||
}
|
||||
else if (edge == NSMaxYEdge)
|
||||
{
|
||||
screenFrame.origin.y += screenRect.size.height;
|
||||
}
|
||||
else if (edge == NSMaxXEdge)
|
||||
{
|
||||
screenFrame.origin.x += screenRect.size.width;
|
||||
}
|
||||
else if (edge == NSMinXEdge)
|
||||
{
|
||||
screenFrame.origin.x -= screenRect.size.width;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (edge == NSMaxYEdge)
|
||||
{
|
||||
screenFrame.origin.y += screenRect.size.height;
|
||||
}
|
||||
else if (edge == NSMaxXEdge)
|
||||
{
|
||||
screenFrame.origin.x += screenRect.size.width;
|
||||
}
|
||||
else if (edge == NSMinXEdge)
|
||||
{
|
||||
screenFrame.origin.x -= screenRect.size.width;
|
||||
}
|
||||
|
||||
|
||||
// Get the frameRect
|
||||
r = [NSWindow frameRectForContentRect: screenFrame
|
||||
styleMask: [_window styleMask]];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue