diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2009-12-03 09:17:51 -0800 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2009-12-03 09:17:51 -0800 |
commit | 5fd2938da8d6709a6596833088fd83c60d591507 (patch) | |
tree | 9186f79b996eb60a9bb1f5cefada86c0596ac850 /indra/newview/llavatarlistitem.cpp | |
parent | 97f97f286ccca1f736c575f516a61c6a32787807 (diff) | |
parent | 57b68d9bfe25fc7b9efe41a9fa30935c156acb34 (diff) |
Merge with recent viewer-2-0
Diffstat (limited to 'indra/newview/llavatarlistitem.cpp')
-rw-r--r-- | indra/newview/llavatarlistitem.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index efc9538fa6..59ed391c06 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -42,7 +42,7 @@ #include "llavatariconctrl.h" #include "llbutton.h" -LLAvatarListItem::LLAvatarListItem() +LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), mAvatarIcon(NULL), mAvatarName(NULL), @@ -55,14 +55,12 @@ LLAvatarListItem::LLAvatarListItem() mShowInfoBtn(true), mShowProfileBtn(true) { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml"); - // Remember avatar icon width including its padding from the name text box, - // so that we can hide and show the icon again later. - - mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; - mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; - mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; - mSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; + if (not_from_ui_factory) + { + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml"); + } + // *NOTE: mantipov: do not use any member here. They can be uninitialized here in case instance + // is created from the UICtrlFactory } LLAvatarListItem::~LLAvatarListItem() @@ -87,6 +85,13 @@ BOOL LLAvatarListItem::postBuild() mProfileBtn->setVisible(false); mProfileBtn->setClickedCallback(boost::bind(&LLAvatarListItem::onProfileBtnClick, this)); + // Remember avatar icon width including its padding from the name text box, + // so that we can hide and show the icon again later. + mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; + mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; + mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; + mSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; + /* if(!p.buttons.profile) { @@ -260,7 +265,7 @@ void LLAvatarListItem::setAvatarIconVisible(bool visible) void LLAvatarListItem::onInfoBtnClick() { - LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarId)); + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId)); /* TODO fix positioning of inspector localPointToScreen(mXPos, mYPos, &mXPos, &mYPos); |