mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 17:32:03 +00:00
More changes to support not highlighting cells when traversing to a submenu.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5242 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fa2c68422a
commit
1d8690f2dc
2 changed files with 25 additions and 10 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
1999-11-19 David Lazaro Saz <khelekir@encomix.es>
|
||||||
|
|
||||||
|
* Source/NSMenuView.m ([NSMenuView -trackWithEvent:]): Added two
|
||||||
|
defines (MOVE_THRESHOLD_DELTA and DELAY_MULTIPLIER) to make nicer the
|
||||||
|
menu traversing.
|
||||||
|
|
||||||
1999-11-18 David Lazaro Saz <khelekir@encomix.es>
|
1999-11-18 David Lazaro Saz <khelekir@encomix.es>
|
||||||
|
|
||||||
* Source/NSPopUpButton.m ([NSPopUpButton +initialize]): Fixed core
|
* Source/NSPopUpButton.m ([NSPopUpButton +initialize]): Fixed core
|
||||||
|
|
|
@ -674,7 +674,8 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
[targetMenuView setHighlightedItemIndex: -1];
|
[targetMenuView setHighlightedItemIndex: -1];
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MOVE_THRESHOLD_DELTA 1
|
#define MOVE_THRESHOLD_DELTA 1.0
|
||||||
|
#define DELAY_MULTIPLIER 12
|
||||||
|
|
||||||
- (BOOL)trackWithEvent: (NSEvent *)event
|
- (BOOL)trackWithEvent: (NSEvent *)event
|
||||||
{
|
{
|
||||||
|
@ -689,6 +690,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
NSPoint lastLocation = {0,0};
|
NSPoint lastLocation = {0,0};
|
||||||
NSMenu *alreadyAttachedMenu = NO;
|
NSMenu *alreadyAttachedMenu = NO;
|
||||||
BOOL delayedSelect = NO;
|
BOOL delayedSelect = NO;
|
||||||
|
int delayCount = DELAY_MULTIPLIER;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -708,6 +710,17 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
- 1)
|
- 1)
|
||||||
[menuv_menu shiftOnScreen];
|
[menuv_menu shiftOnScreen];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([event type] == NSPeriodic && delayedSelect && !delayCount)
|
||||||
|
{
|
||||||
|
if (location.x - lastLocation.x < MOVE_THRESHOLD_DELTA ||
|
||||||
|
abs(location.y - lastLocation.y) < MOVE_THRESHOLD_DELTA)
|
||||||
|
delayedSelect = NO;
|
||||||
|
|
||||||
|
lastLocation = location;
|
||||||
|
}
|
||||||
|
|
||||||
|
delayCount = delayCount ? --delayCount : DELAY_MULTIPLIER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
|
@ -731,15 +744,6 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
{
|
{
|
||||||
if (index != menuv_highlightedItemIndex)
|
if (index != menuv_highlightedItemIndex)
|
||||||
{
|
{
|
||||||
if ([event type] == NSPeriodic && delayedSelect)
|
|
||||||
{
|
|
||||||
if (location.x - lastLocation.x < MOVE_THRESHOLD_DELTA ||
|
|
||||||
abs(location.y - lastLocation.y) < MOVE_THRESHOLD_DELTA)
|
|
||||||
delayedSelect = NO;
|
|
||||||
|
|
||||||
lastLocation = location;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (![menuv_menu attachedMenu] || !delayedSelect)
|
if (![menuv_menu attachedMenu] || !delayedSelect)
|
||||||
{
|
{
|
||||||
[self setHighlightedItemIndex: index];
|
[self setHighlightedItemIndex: index];
|
||||||
|
@ -752,6 +756,11 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
{
|
{
|
||||||
[self attachSubmenuForItemAtIndex: index];
|
[self attachSubmenuForItemAtIndex: index];
|
||||||
delayedSelect = YES;
|
delayedSelect = YES;
|
||||||
|
delayCount = DELAY_MULTIPLIER;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
delayedSelect = NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue