Improved the code still a little bit. Menus seems to be somewhat more
responsive. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23282 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b44b755c91
commit
3e06c4fae2
@ -67,6 +67,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
|
||||
@ -1393,10 +1394,8 @@ BMenu::_Track(int *action, long start)
|
||||
_UpdateStateOpenSelect(item, openTime, closeTime);
|
||||
if (!releasedOnce)
|
||||
releasedOnce = true;
|
||||
}
|
||||
|
||||
// Track the submenu
|
||||
if (_OverSubmenu(fSelected, screenLocation)) {
|
||||
} else if (_OverSubmenu(fSelected, screenLocation)) {
|
||||
// Since the submenu has its own looper,
|
||||
// we can unlock ours. Doing so also make sure
|
||||
// that our window gets any update message to
|
||||
@ -1417,12 +1416,13 @@ BMenu::_Track(int *action, long start)
|
||||
}
|
||||
if (!LockLooper())
|
||||
break;
|
||||
} else if (item == NULL) {
|
||||
if (_OverSuper(screenLocation)) {
|
||||
} else if (_OverSuper(screenLocation)) {
|
||||
fState = MENU_STATE_TRACKING;
|
||||
UnlockLooper();
|
||||
break;
|
||||
} else {
|
||||
// Mouse pointer outside menu
|
||||
|
||||
if (system_time() > closeTime + kHysteresis
|
||||
&& fState != MENU_STATE_TRACKING_SUBMENU) {
|
||||
_SelectItem(NULL);
|
||||
@ -1436,7 +1436,6 @@ BMenu::_Track(int *action, long start)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UnlockLooper();
|
||||
|
||||
|
@ -496,9 +496,7 @@ BMenuBar::_Track(int32 *action, int32 startIndex, bool showMenu)
|
||||
_SelectItem(menuItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_OverSubmenu(fSelected, ConvertToScreen(where))) {
|
||||
} else if (_OverSubmenu(fSelected, ConvertToScreen(where))) {
|
||||
// call _Track() from the selected sub-menu when the mouse cursor
|
||||
// is over its window
|
||||
BMenu *menu = fSelected->Submenu();
|
||||
|
Loading…
Reference in New Issue
Block a user