Commits

Anonymous committed 1e6a789

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.

  • Participants
  • Parent commits a564252

Comments (0)

Files changed (2)

File indra/newview/llwearableitemslist.cpp

 	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)
 	{
 		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)

File indra/newview/skins/default/xui/en/menu_wearable_list_item.xml

         <on_click
          function="Wearable.CreateNew" />
     </menu_item_call>
+    <menu_item_call
+     label="--no options--"
+     layout="topleft"
+     name="--no options--"
+     translate="false">
+    </menu_item_call>
 </context_menu>