From 9f835b9bce6ac023a9f8b98cfb53015f5d416130 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 24 Jun 2010 19:03:20 -0400 Subject: EXT-7902 FIXED Corrupted context menu appears on "Add More" panel if both worn and not-worn items were selected Added "no options" menu item instead of showing blank context menu. --- indra/newview/llwearableitemslist.cpp | 16 ++++++++++++++++ .../skins/default/xui/en/menu_wearable_list_item.xml | 6 ++++++ 2 files changed, 22 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index da15b93697..b2aac75916 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -673,6 +673,8 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu setMenuItemEnabled(menu, "take_off_or_detach", n_worn == n_items); setMenuItemVisible(menu, "object_profile", !standalone); setMenuItemEnabled(menu, "object_profile", n_items == 1); + setMenuItemVisible(menu, "--no options--", FALSE); + setMenuItemEnabled(menu, "--no options--", FALSE); // Populate or hide the "Attach to..." / "Attach to HUD..." submenus. if (mask == MASK_ATTACHMENT && n_worn == 0) @@ -689,6 +691,20 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu { llwarns << "Non-wearable items passed." << llendl; } + + U32 num_visible_items = 0; + for (U32 menu_item_index = 0; menu_item_index < menu->getItemCount(); ++menu_item_index) + { + const LLMenuItemGL* menu_item = menu->getItem(menu_item_index); + if (menu_item && menu_item->getVisible()) + { + num_visible_items++; + } + } + if (num_visible_items == 0) + { + setMenuItemVisible(menu, "--no options--", TRUE); + } } void LLWearableItemsList::ContextMenu::updateItemsLabels(LLContextMenu* menu) diff --git a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml index efea2ae3e8..23eb89e448 100644 --- a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml +++ b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml @@ -73,4 +73,10 @@ + + -- cgit v1.2.3