Patch by maxime.simon: Don't allow to enter sub-menus by the space bar anymore.

This allows to have the first item selected when entering a menu, since still
pressing space would not enter it unintentionally anymore, in case it's a sub-
menu again. Even though it makes some sense to have "Continue booting" selected
by default, it somehow feels more natural to have the first item always selected
instead. Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29832 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-03-31 16:28:50 +00:00
parent 48bd26db93
commit d30acbf30b

View File

@ -352,7 +352,7 @@ run_menu(Menu *menu)
int32 selected;
MenuItem *item = menu->FindSelected(&selected);
if (item == NULL) {
selected = menu->CountItems() - 1;
selected = 0;
item = menu->ItemAt(selected);
if (item != NULL)
item->Select(true);
@ -414,7 +414,7 @@ run_menu(Menu *menu)
} else if (key == TEXT_CONSOLE_KEY_RETURN
|| key == TEXT_CONSOLE_KEY_SPACE) {
// leave the menu
if (item->Submenu() != NULL) {
if (item->Submenu() != NULL && key == TEXT_CONSOLE_KEY_RETURN) {
int32 offset = sMenuOffset;
menu->Hide();