diff options
author | Richard Linden <none@none> | 2012-01-12 13:16:28 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2012-01-12 13:16:28 -0800 |
commit | f1c27071047e776536f8aa963b83f8772275e7c3 (patch) | |
tree | a0a74e20cdb688471af361c8fc078260bd7988dc /indra/llui/lltoolbar.cpp | |
parent | 3dfb1536fa3bb85f6648a76591e80c3feea9eb83 (diff) | |
parent | 26829e6fa2de6e59f46ba340ca7ad6c430728470 (diff) |
Automated merge with https://bitbucket.org/lindenlab/viewer-development
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r-- | indra/llui/lltoolbar.cpp | 9 |
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; |