Greatly improved BMenuBar::Track(). Now it uses a simple tracking loop instad of two nested loops. BMenu will follow, someday.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13150 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2005-06-15 11:37:05 +00:00
parent b497352618
commit 757ce6e540
2 changed files with 35 additions and 49 deletions
+2 -2
View File
@@ -1525,7 +1525,7 @@ BMenu::Uninstall()
void
BMenu::SelectItem(BMenuItem *menuItem, uint32 showSubmenu, bool selectFirstItem)
{
// TODO: make use of "showSubmenu" and "selectFirstItem".
// TODO: make use of "selectFirstItem".
if (fSelected != NULL) {
fSelected->Select(false);
if (fSelected->Submenu() != NULL)
@@ -1536,7 +1536,7 @@ BMenu::SelectItem(BMenuItem *menuItem, uint32 showSubmenu, bool selectFirstItem)
menuItem->Select(true);
fSelected = menuItem;
if (fSelected != NULL && fSelected->Submenu() != NULL)
if (fSelected != NULL && showSubmenu == 0 && fSelected->Submenu() != NULL)
fSelected->Submenu()->_show();
}