diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2010-11-24 18:56:21 +0200 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2010-11-24 18:56:21 +0200 |
commit | 552ddf4be4a5b906fb65b477cfba68da54bb8ec2 (patch) | |
tree | 3d250ecb1661a5a5c543ccd20ae2516228f42b99 /indra/newview/llpanelplaces.cpp | |
parent | d7d23d16246e182c1cc74a57cac357aaa5c6c8e2 (diff) |
STORM-666 FIXED Menu spawned by the overflow button had invalid position in Place Profile and Avatar Profile panels.
Changes:
* Changed the button class from LLButton to LLMenuButton to avoid duplicating menu positioning logic.
* Enabled LLMenuButton to support aligning menu to the top right corner of the button.
Diffstat (limited to 'indra/newview/llpanelplaces.cpp')
-rw-r--r-- | indra/newview/llpanelplaces.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index f0e60386b6..c524fd7059 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -39,6 +39,7 @@ #include "llfiltereditor.h" #include "llfirstuse.h" #include "llfloaterreg.h" +#include "llmenubutton.h" #include "llnotificationsutil.h" #include "lltabcontainer.h" #include "lltexteditor.h" @@ -282,8 +283,8 @@ BOOL LLPanelPlaces::postBuild() mCloseBtn = getChild<LLButton>("close_btn"); mCloseBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onBackButtonClicked, this)); - mOverflowBtn = getChild<LLButton>("overflow_btn"); - mOverflowBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onOverflowButtonClicked, this)); + mOverflowBtn = getChild<LLMenuButton>("overflow_btn"); + mOverflowBtn->setMouseDownCallback(boost::bind(&LLPanelPlaces::onOverflowButtonClicked, this)); mPlaceInfoBtn = getChild<LLButton>("profile_btn"); mPlaceInfoBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onProfileButtonClicked, this)); @@ -783,16 +784,7 @@ void LLPanelPlaces::onOverflowButtonClicked() return; } - if (!menu->toggleVisibility()) - return; - - if (menu->getButtonRect().isEmpty()) - { - menu->setButtonRect(mOverflowBtn); - } - menu->updateParent(LLMenuGL::sMenuContainer); - LLRect rect = mOverflowBtn->getRect(); - LLMenuGL::showPopup(this, menu, rect.mRight, rect.mTop); + mOverflowBtn->setMenu(menu, LLMenuButton::MP_TOP_RIGHT); } void LLPanelPlaces::onProfileButtonClicked() |