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:
+19
-20
@@ -67,6 +67,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|
||||||
|
|
||||||
@@ -1393,10 +1394,8 @@ BMenu::_Track(int *action, long start)
|
|||||||
_UpdateStateOpenSelect(item, openTime, closeTime);
|
_UpdateStateOpenSelect(item, openTime, closeTime);
|
||||||
if (!releasedOnce)
|
if (!releasedOnce)
|
||||||
releasedOnce = true;
|
releasedOnce = true;
|
||||||
}
|
|
||||||
|
|
||||||
// Track the submenu
|
} else if (_OverSubmenu(fSelected, screenLocation)) {
|
||||||
if (_OverSubmenu(fSelected, screenLocation)) {
|
|
||||||
// Since the submenu has its own looper,
|
// Since the submenu has its own looper,
|
||||||
// we can unlock ours. Doing so also make sure
|
// we can unlock ours. Doing so also make sure
|
||||||
// that our window gets any update message to
|
// that our window gets any update message to
|
||||||
@@ -1417,24 +1416,24 @@ BMenu::_Track(int *action, long start)
|
|||||||
}
|
}
|
||||||
if (!LockLooper())
|
if (!LockLooper())
|
||||||
break;
|
break;
|
||||||
} else if (item == NULL) {
|
} else if (_OverSuper(screenLocation)) {
|
||||||
if (_OverSuper(screenLocation)) {
|
fState = MENU_STATE_TRACKING;
|
||||||
fState = MENU_STATE_TRACKING;
|
UnlockLooper();
|
||||||
UnlockLooper();
|
break;
|
||||||
break;
|
} else {
|
||||||
} else {
|
// Mouse pointer outside menu
|
||||||
if (system_time() > closeTime + kHysteresis
|
|
||||||
&& fState != MENU_STATE_TRACKING_SUBMENU) {
|
|
||||||
_SelectItem(NULL);
|
|
||||||
fState = MENU_STATE_TRACKING;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fSuper != NULL) {
|
if (system_time() > closeTime + kHysteresis
|
||||||
// Give supermenu the chance to continue tracking
|
&& fState != MENU_STATE_TRACKING_SUBMENU) {
|
||||||
*action = fState;
|
_SelectItem(NULL);
|
||||||
UnlockLooper();
|
fState = MENU_STATE_TRACKING;
|
||||||
return NULL;
|
}
|
||||||
}
|
|
||||||
|
if (fSuper != NULL) {
|
||||||
|
// Give supermenu the chance to continue tracking
|
||||||
|
*action = fState;
|
||||||
|
UnlockLooper();
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -496,9 +496,7 @@ BMenuBar::_Track(int32 *action, int32 startIndex, bool showMenu)
|
|||||||
_SelectItem(menuItem);
|
_SelectItem(menuItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (_OverSubmenu(fSelected, ConvertToScreen(where))) {
|
||||||
|
|
||||||
if (_OverSubmenu(fSelected, ConvertToScreen(where))) {
|
|
||||||
// call _Track() from the selected sub-menu when the mouse cursor
|
// call _Track() from the selected sub-menu when the mouse cursor
|
||||||
// is over its window
|
// is over its window
|
||||||
BMenu *menu = fSelected->Submenu();
|
BMenu *menu = fSelected->Submenu();
|
||||||
|
|||||||
Reference in New Issue
Block a user