mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 00:20:49 +00:00
Fix to display highlighted menu items when they are triggered from the keyboard;
fix for wrong highlighting of menu items in popupbuttons when used from the keyboard git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15661 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f05ccae9de
commit
8bda7ef823
1 changed files with 12 additions and 4 deletions
|
@ -28,7 +28,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <Foundation/NSThread.h>
|
#include <Foundation/NSRunLoop.h>
|
||||||
|
|
||||||
#include <AppKit/NSApplication.h>
|
#include <AppKit/NSApplication.h>
|
||||||
#include <AppKit/NSEvent.h>
|
#include <AppKit/NSEvent.h>
|
||||||
|
@ -878,10 +878,18 @@ _addLeftBorderOffsetToRect(NSRect aRect, BOOL isHorizontal)
|
||||||
|
|
||||||
[targetMenuView setHighlightedItemIndex: indexToHighlight];
|
[targetMenuView setHighlightedItemIndex: indexToHighlight];
|
||||||
|
|
||||||
[_menu performActionForItemAtIndex: index];
|
/* We need to let the run loop run a little so that the fact that
|
||||||
[NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]];
|
* the item is highlighted gets displayed on screen.
|
||||||
|
*/
|
||||||
|
[[NSRunLoop currentRunLoop]
|
||||||
|
runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]];
|
||||||
|
|
||||||
[targetMenuView setHighlightedItemIndex: -1];
|
[_menu performActionForItemAtIndex: index];
|
||||||
|
|
||||||
|
if (![_menu _ownedByPopUp])
|
||||||
|
{
|
||||||
|
[targetMenuView setHighlightedItemIndex: -1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MOVE_THRESHOLD_DELTA 2.0
|
#define MOVE_THRESHOLD_DELTA 2.0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue