mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +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
b49179235d
commit
59d5a9818b
2 changed files with 39 additions and 21 deletions
|
@ -1,3 +1,12 @@
|
|||
2009-04-10 00:53-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* 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.
|
||||
|
||||
2009-04-09 22:55-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Source/NSRulerMarker.m: Changes suggested by Doug Simons for
|
||||
|
|
|
@ -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…
Reference in a new issue