From df13a980fe154a88eb6bb140a9550b765bb417a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 17 Oct 2005 10:05:39 +0000 Subject: [PATCH] Mixed up concepts of a selected and a marked item - the Menu::ChoiceText() is now set correctly (it behaved a bit fuzzy before). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14396 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/loader/menu.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/system/boot/loader/menu.cpp b/src/system/boot/loader/menu.cpp index 46a731be37..4d1cd67241 100644 --- a/src/system/boot/loader/menu.cpp +++ b/src/system/boot/loader/menu.cpp @@ -56,9 +56,20 @@ MenuItem::SetTarget(menu_item_hook target) } +/** Marks or unmarks a menu item. A marked menu item usually gets a visual + * clue like a checkmark that distinguishes it from others. + * For menus of type CHOICE_MENU, there can only be one marked item - the + * chosen one. + */ + void MenuItem::SetMarked(bool marked) { + if (marked && fMenu != NULL && fMenu->Type() == CHOICE_MENU) { + // always set choice text of parent if we were marked + fMenu->SetChoiceText(Label()); + } + if (fIsMarked == marked) return; @@ -79,12 +90,6 @@ MenuItem::SetMarked(bool marked) void MenuItem::Select(bool selected) { - if (selected && fMenu != NULL) { - // always set choice text of parent if we were selected - if (fMenu->Type() == CHOICE_MENU && Type() != MENU_ITEM_NO_CHOICE) - fMenu->SetChoiceText(Label()); - } - if (fIsSelected == selected) return;