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
This commit is contained in:
parent
47a6a63e35
commit
df13a980fe
@ -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
|
void
|
||||||
MenuItem::SetMarked(bool marked)
|
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)
|
if (fIsMarked == marked)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -79,12 +90,6 @@ MenuItem::SetMarked(bool marked)
|
|||||||
void
|
void
|
||||||
MenuItem::Select(bool selected)
|
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)
|
if (fIsSelected == selected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user