summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2010-10-15 00:10:55 +0300
committerSeth ProductEngine <slitovchuk@productengine.com>2010-10-15 00:10:55 +0300
commitc12c60df4a28b3cb91870ae0666eb6b3422ff96b (patch)
tree953874961639fb1be1be3c8b3d569fdbadd83323 /indra/newview/llpanelmaininventory.cpp
parente8a4b9308a141d358d91eb2dbcb82548d2ff93cb (diff)
STORM-263 FIXED popup menu of Cog button in lower-left of sidebar panel closing on second click
- Changed type of gear menu buttons from LLButton to LLMenuButton in all sidebar panels where gear menu button is used. - Added setMenuPosition(), setMenu() and updateMenuOrigin() to the LLMenuButton. - Moved actions common for displaying a context menu to LLMenuButton::toggleMenu(). - In all sidebar panels where LLButton was replaced with LLMenuButton the following steps were taken: 1. setting gearMenu and its position relative to the menuButton with LLMenuButton::setMenu() 2. setting mouse down callback for the menuButton if needed. 3. calculating the menu origin point with LLMenuButton::updateMenuOrigin() in mouse down callback
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 5b07e4863b..cc69dbd9d4 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -39,6 +39,7 @@
#include "llinventorypanel.h"
#include "llfiltereditor.h"
#include "llfloaterreg.h"
+#include "llmenubutton.h"
#include "lloutfitobserver.h"
#include "llpreviewtexture.h"
#include "llresmgr.h"
@@ -192,6 +193,8 @@ BOOL LLPanelMainInventory::postBuild()
mFilterEditor->setCommitCallback(boost::bind(&LLPanelMainInventory::onFilterEdit, this, _2));
}
+ mGearMenuButton = getChild<LLMenuButton>("options_gear_btn");
+
initListCommandsHandlers();
// *TODO:Get the cost info from the server
@@ -900,7 +903,6 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data)
void LLPanelMainInventory::initListCommandsHandlers()
{
- childSetAction("options_gear_btn", boost::bind(&LLPanelMainInventory::onGearButtonClick, this));
childSetAction("trash_btn", boost::bind(&LLPanelMainInventory::onTrashButtonClick, this));
childSetAction("add_btn", boost::bind(&LLPanelMainInventory::onAddButtonClick, this));
@@ -914,6 +916,7 @@ void LLPanelMainInventory::initListCommandsHandlers()
mCommitCallbackRegistrar.add("Inventory.GearDefault.Custom.Action", boost::bind(&LLPanelMainInventory::onCustomAction, this, _2));
mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2));
mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+ mGearMenuButton->setMenu(mMenuGearDefault);
mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
// Update the trash button when selected item(s) get worn or taken off.
@@ -927,11 +930,6 @@ void LLPanelMainInventory::updateListCommands()
mTrashButton->setEnabled(trash_enabled);
}
-void LLPanelMainInventory::onGearButtonClick()
-{
- showActionMenu(mMenuGearDefault,"options_gear_btn");
-}
-
void LLPanelMainInventory::onAddButtonClick()
{
setUploadCostIfNeeded();