diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2012-02-27 11:51:57 -0500 |
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2012-02-27 11:51:57 -0500 |
| commit | e7ab3da7a7f5c68e3544a64c30f011762572995a (patch) | |
| tree | 65a8aab420f23e7b53c72c7326a26a6c4901489f /indra/llui/lltoolbar.cpp | |
| parent | c0318d1bf988217e1fbb0593d03c4f0235a13ea3 (diff) | |
| parent | 4a7848148e886676dd24bfcf4f50db06bffb28da (diff) | |
Automated merge with file:///Users/nat/linden/viewer-leap-daggy
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; |
