Make pop up menus in Macintosh menu style behave more similar to OS X.

In particular, when the user clicks the button, the menu stays open
until the next click.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31801 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-12-30 20:10:37 +00:00
parent 2583abd450
commit b436fc237c
2 changed files with 16 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2010-12-30 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSMenuView.m (-trackWithEvent:):
Make pop up menus in Macintosh menu style behave more similar to
OS X. In particular, when the user clicks the button, the menu
stays open until the next click.
2010-12-30 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSMenuView.m (-update):

View file

@ -1465,7 +1465,15 @@ static NSMapTable *viewInfo = 0;
eventMask |= NSLeftMouseDownMask;
}
if ([self isHorizontal] == YES)
/* We attempt to mimic Mac OS X behavior for pop up menus. If the user
presses the mouse button over a pop up button and then drags the mouse
over the menu, the is closed when the user releases the mouse. On the
other hand, when the user clicks on the button and then moves the mouse
the menu is closed upon the next mouse click. */
if ([self isHorizontal] == YES ||
([[self menu] _ownedByPopUp] == YES &&
NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self)
== NSMacintoshInterfaceStyle))
{
/*
* Ignore the first mouse up if nothing interesting has happened.