mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 18:10:49 +00:00
Applied changes in menuInWindow.patch
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31895 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a99e46fa36
commit
b3d789fcec
6 changed files with 50 additions and 32 deletions
|
@ -1389,14 +1389,21 @@ static NSMapTable *viewInfo = 0;
|
|||
- (BOOL) _executeItemAtIndex: (int)indexOfActionToExecute
|
||||
removeSubmenu: (BOOL)subMenusNeedRemoving
|
||||
{
|
||||
NSInterfaceStyle style =
|
||||
NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self);
|
||||
|
||||
/*If we have menu in window, close the menu after select
|
||||
an option*/
|
||||
if (style == NSWindows95InterfaceStyle)
|
||||
{
|
||||
[[[[NSApp mainWindow] menu] attachedMenu] close];
|
||||
}
|
||||
|
||||
if (indexOfActionToExecute >= 0
|
||||
&& [_attachedMenu attachedMenu] != nil && [_attachedMenu attachedMenu] ==
|
||||
[[_items_link objectAtIndex: indexOfActionToExecute] submenu])
|
||||
{
|
||||
NSInterfaceStyle style =
|
||||
NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self);
|
||||
if (style == NSMacintoshInterfaceStyle ||
|
||||
style == NSWindows95InterfaceStyle)
|
||||
if (style == NSMacintoshInterfaceStyle)
|
||||
{
|
||||
// On Macintosh, clicking on or releasing the mouse over a
|
||||
// submenu item always closes the menu (if it is open) and
|
||||
|
@ -1405,6 +1412,11 @@ static NSMapTable *viewInfo = 0;
|
|||
return YES;
|
||||
}
|
||||
|
||||
if (style == NSWindows95InterfaceStyle)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
if (subMenusNeedRemoving)
|
||||
{
|
||||
[self detachSubmenu];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue