summaryrefslogtreecommitdiff
path: root/indra/newview/lloutfitslist.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/lloutfitslist.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/lloutfitslist.cpp')
-rw-r--r--indra/newview/lloutfitslist.cpp27
1 files changed, 8 insertions, 19 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index db9d386b6b..33c968bf00 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -38,6 +38,7 @@
#include "llinventoryfunctions.h"
#include "llinventorymodel.h"
#include "lllistcontextmenu.h"
+#include "llmenubutton.h"
#include "llnotificationsutil.h"
#include "lloutfitobserver.h"
#include "llsidetray.h"
@@ -126,18 +127,6 @@ public:
llassert(mMenu);
}
- void show(LLView* spawning_view)
- {
- if (!mMenu) return;
-
- updateItemsVisibility();
- mMenu->buildDrawLabels();
- mMenu->updateParent(LLMenuGL::sMenuContainer);
- S32 menu_x = 0;
- S32 menu_y = spawning_view->getRect().getHeight() + mMenu->getRect().getHeight();
- LLMenuGL::showPopup(spawning_view, mMenu, menu_x, menu_y);
- }
-
void updateItemsVisibility()
{
if (!mMenu) return;
@@ -148,6 +137,8 @@ public:
mMenu->arrangeAndClear(); // update menu height
}
+ LLMenuGL* getMenu() { return mMenu; }
+
private:
const LLUUID& getSelectedOutfitID()
{
@@ -386,6 +377,11 @@ BOOL LLOutfitsList::postBuild()
mAccordion = getChild<LLAccordionCtrl>("outfits_accordion");
mAccordion->setComparator(&OUTFIT_TAB_NAME_COMPARATOR);
+ LLMenuButton* menu_gear_btn = getChild<LLMenuButton>("options_gear_btn");
+
+ menu_gear_btn->setMouseDownCallback(boost::bind(&LLOutfitListGearMenu::updateItemsVisibility, mGearMenu));
+ menu_gear_btn->setMenu(mGearMenu->getMenu());
+
return TRUE;
}
@@ -727,13 +723,6 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata)
return false;
}
-// virtual
-void LLOutfitsList::showGearMenu(LLView* spawning_view)
-{
- if (!mGearMenu) return;
- mGearMenu->show(spawning_view);
-}
-
void LLOutfitsList::getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const
{
// Collect selected items from all selected lists.