mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 12:50:40 +00:00
Implemented method which prepares the window for pop-up buttons.
Tiny changing to make popup buttons selections work. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5441 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e33b564c2f
commit
e23d001519
1 changed files with 26 additions and 2 deletions
|
@ -607,7 +607,31 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
|||
preferredEdge: (NSRectEdge)edge
|
||||
popUpSelectedItem: (int)selectedItemIndex
|
||||
{
|
||||
// Huh!?
|
||||
NSRect r;
|
||||
|
||||
// Move the menu window to screen?
|
||||
// TODO
|
||||
|
||||
// Compute position for popups, if needed
|
||||
if (selectedItemIndex > -1)
|
||||
{
|
||||
screenRect.origin.y += ([self convertSize: cellSize
|
||||
toView: nil].height
|
||||
* selectedItemIndex);
|
||||
}
|
||||
|
||||
// Get the frameRect
|
||||
r = [NSMenuWindow frameRectForContentRect: screenRect
|
||||
styleMask: [window styleMask]];
|
||||
|
||||
// Update position,if needed, using the preferredEdge;
|
||||
// It seems we should be calling [self resizeWindowWithMaxHeight: ];
|
||||
// see the (quite obscure) doc.
|
||||
// TODO
|
||||
|
||||
// Set the window frame
|
||||
[window setFrame: r
|
||||
display: YES];
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -790,7 +814,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
|||
[NSEvent stopPeriodicEvents];
|
||||
[menuv_menu performActionForItemAtIndex: index];
|
||||
|
||||
if (![menuv_menu isFollowTransient])
|
||||
if (![menuv_menu isFollowTransient] && ![menuv_menu _ownedByPopUp])
|
||||
[self setHighlightedItemIndex: -1];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue