summaryrefslogtreecommitdiff
path: root/indra/llui/lltoolbar.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2012-01-17 13:31:48 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2012-01-17 13:31:48 -0500
commita7b642d358f0e5649642db3084143b224f7e977d (patch)
tree2abc31a48494a2874c28bc7566c7864af362a1ea /indra/llui/lltoolbar.cpp
parent3ed8f8907665d8700199a1181a5dd106a6804edb (diff)
parent64c45cbd1ace677456db56d1a506f2fe44b6e9c6 (diff)
merge
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r--indra/llui/lltoolbar.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 7f96c1373c..9b31a6449d 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -151,14 +151,20 @@ void LLToolBar::createContextMenu()
if (menu)
{
menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor"));
-
mPopupMenuHandle = menu->getHandle();
+ mRemoveButtonHandle = menu->getChild<LLView>("Remove button")->getHandle();
}
else
{
llwarns << "Unable to load toolbars context menu." << llendl;
}
}
+
+ if (mRemoveButtonHandle.get())
+ {
+ // Disable/Enable the "Remove button" menu item depending on whether or not a button was clicked
+ mRemoveButtonHandle.get()->setEnabled(mRightMouseTargetButton != NULL);
+ }
}
void LLToolBar::initFromParams(const LLToolBar::Params& p)
@@ -401,6 +407,7 @@ BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
// Determine which button the mouse was over during the click in case the context menu action
// is intended to affect the button.
+ mRightMouseTargetButton = NULL;
BOOST_FOREACH(LLToolBarButton* button, mButtons)
{
LLRect button_rect;