diff options
author | Eric M. Tulla (BigPapi) <tulla@lindenlab.com> | 2009-11-17 17:58:17 -0500 |
---|---|---|
committer | Eric M. Tulla (BigPapi) <tulla@lindenlab.com> | 2009-11-17 17:58:17 -0500 |
commit | 32178873564f86f0ab9ee06d485486fc9d609012 (patch) | |
tree | 4beae7908cbdd5e6af5241682110ac958b7c56ae /indra/newview/llpanelavatar.cpp | |
parent | 064fb26092ac9f73f9d0301f1e214e27e8418839 (diff) | |
parent | 2365dbcd459b37942ddacbcb7010232113a126c1 (diff) |
Merge of viewer2 into avp
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llpanelavatar.cpp')
-rw-r--r-- | indra/newview/llpanelavatar.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 3b54f1546e..2254684f21 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -41,6 +41,7 @@ #include "llimview.h" #include "lltexteditor.h" #include "lltexturectrl.h" +#include "lltoggleablemenu.h" #include "lltooldraganddrop.h" #include "llscrollcontainer.h" #include "llavatariconctrl.h" @@ -333,8 +334,14 @@ BOOL LLPanelAvatarProfile::postBuild() childSetCommitCallback("im",(boost::bind(&LLPanelAvatarProfile::onIMButtonClick,this)),NULL); childSetCommitCallback("call",(boost::bind(&LLPanelAvatarProfile::onCallButtonClick,this)),NULL); childSetCommitCallback("teleport",(boost::bind(&LLPanelAvatarProfile::onTeleportButtonClick,this)),NULL); + childSetCommitCallback("overflow_btn", boost::bind(&LLPanelAvatarProfile::onOverflowButtonClicked, this), NULL); childSetCommitCallback("share",(boost::bind(&LLPanelAvatarProfile::onShareButtonClick,this)),NULL); + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + registrar.add("Profile.Pay", boost::bind(&LLPanelAvatarProfile::pay, this)); + + mProfileMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + LLTextureCtrl* pic = getChild<LLTextureCtrl>("2nd_life_pic"); pic->setFallbackImageName("default_profile_picture.j2c"); @@ -513,6 +520,11 @@ void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data) childSetValue("acc_status_text", caption_text); } +void LLPanelAvatarProfile::pay() +{ + LLAvatarActions::pay(getAvatarId()); +} + void LLPanelAvatarProfile::onUrlTextboxClicked(const std::string& url) { LLWeb::loadURL(url); @@ -552,6 +564,23 @@ void LLPanelAvatarProfile::onShareButtonClick() //*TODO not implemented } +void LLPanelAvatarProfile::onOverflowButtonClicked() +{ + if (!mProfileMenu->toggleVisibility()) + return; + + LLView* btn = getChild<LLView>("overflow_btn"); + + if (mProfileMenu->getButtonRect().isEmpty()) + { + mProfileMenu->setButtonRect(btn); + } + mProfileMenu->updateParent(LLMenuGL::sMenuContainer); + + LLRect rect = btn->getRect(); + LLMenuGL::showPopup(this, mProfileMenu, rect.mRight, rect.mTop); +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// |