mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 12:50:40 +00:00
Merge original in-window menu branch.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33924 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
92b44ffa68
commit
0de761d88e
4 changed files with 58 additions and 49 deletions
|
@ -86,6 +86,17 @@ static NSMapTable *viewInfo = 0;
|
|||
/* A menu's title is an instance of this class */
|
||||
@class NSButton;
|
||||
|
||||
@interface NSMenu (Private)
|
||||
- (void) _attachMenu: (NSMenu*)aMenu;
|
||||
@end
|
||||
|
||||
@implementation NSMenu (Private)
|
||||
- (void) _attachMenu: (NSMenu*)aMenu
|
||||
{
|
||||
_attachedMenu = aMenu;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface NSMenuView (Private)
|
||||
- (BOOL) _rootIsHorizontal: (BOOL*)isAppMenu;
|
||||
@end
|
||||
|
@ -548,6 +559,8 @@ static NSMapTable *viewInfo = 0;
|
|||
else
|
||||
{
|
||||
[attachedMenu close];
|
||||
// Unselect the active item
|
||||
[self setHighlightedItemIndex: -1];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -577,7 +590,11 @@ static NSMapTable *viewInfo = 0;
|
|||
else
|
||||
{
|
||||
NSDebugLLog (@"NSMenu", @"Will open normal: %@", attachableMenu);
|
||||
[attachableMenu display];
|
||||
// FIXME: Only resize when needed
|
||||
[attachableMenu sizeToFit];
|
||||
[[attachableMenu window] setFrameOrigin: [self locationForSubmenu: attachableMenu]];
|
||||
[_attachedMenu _attachMenu: attachableMenu];
|
||||
[[attachableMenu window] orderFrontRegardless];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue