Skip to content
Snippets Groups Projects
Commit 7ed3d636 authored by Yuri Chebotarev's avatar Yuri Chebotarev
Browse files

merge

--HG--
branch : product-engine
parents 3c03ea38 ba539933
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,8 @@ static const LLFlatListView::ItemReverseComparator REVERSE_NAME_COMPARATOR(NAME_
LLAvatarList::Params::Params()
: ignore_online_status("ignore_online_status", false)
, show_last_interaction_time("show_last_interaction_time", false)
, show_info_btn("show_info_btn", true)
, show_profile_btn("show_profile_btn", true)
{
}
......@@ -89,6 +91,9 @@ LLAvatarList::LLAvatarList(const Params& p)
, mContextMenu(NULL)
, mDirty(true) // to force initial update
, mLITUpdateTimer(NULL)
, mShowIcons(true)
, mShowInfoBtn(p.show_info_btn)
, mShowProfileBtn(p.show_profile_btn)
{
setCommitOnSelectionChange(true);
......@@ -253,6 +258,8 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is
item->childSetVisible("info_btn", false);
item->setAvatarIconVisible(mShowIcons);
item->setShowInfoBtn(mShowInfoBtn);
item->setShowProfileBtn(mShowProfileBtn);
addItem(item, id, pos);
}
......
......@@ -59,6 +59,8 @@ class LLAvatarList : public LLFlatListView
{
Optional<bool> ignore_online_status; // show all items as online
Optional<bool> show_last_interaction_time; // show most recent interaction time. *HACK: move this to a derived class
Optional<bool> show_info_btn;
Optional<bool> show_profile_btn;
Params();
};
......@@ -96,6 +98,8 @@ class LLAvatarList : public LLFlatListView
bool mShowLastInteractionTime;
bool mDirty;
bool mShowIcons;
bool mShowInfoBtn;
bool mShowProfileBtn;
LLTimer* mLITUpdateTimer; // last interaction time update timer
std::string mIconParamName;
......
......@@ -42,8 +42,6 @@
#include "llavatariconctrl.h"
#include "llbutton.h"
S32 LLAvatarListItem::sIconWidth = 0;
LLAvatarListItem::LLAvatarListItem()
: LLPanel(),
mAvatarIcon(NULL),
......@@ -53,15 +51,17 @@ LLAvatarListItem::LLAvatarListItem()
mInfoBtn(NULL),
mProfileBtn(NULL),
mContextMenu(NULL),
mOnlineStatus(E_UNKNOWN)
mOnlineStatus(E_UNKNOWN),
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.
if (!sIconWidth)
{
sIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft;
}
mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft;
mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight;
mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight;
}
LLAvatarListItem::~LLAvatarListItem()
......@@ -116,8 +116,8 @@ BOOL LLAvatarListItem::postBuild()
void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask)
{
childSetVisible("hovered_icon", true);
mInfoBtn->setVisible(true);
mProfileBtn->setVisible(true);
mInfoBtn->setVisible(mShowInfoBtn);
mProfileBtn->setVisible(mShowProfileBtn);
LLPanel::onMouseEnter(x, y, mask);
}
......@@ -202,6 +202,34 @@ void LLAvatarListItem::setLastInteractionTime(const std::string& val)
mLastInteractionTime->setValue(val);
}
void LLAvatarListItem::setShowInfoBtn(bool show)
{
// Already done? Then do nothing.
if(mShowInfoBtn == show)
return;
mShowInfoBtn = show;
S32 width_delta = show ? - mInfoBtnWidth : mInfoBtnWidth;
//Translating speaking indicator
mSpeakingIndicator->translate(width_delta, 0);
//Reshaping avatar name
mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight());
}
void LLAvatarListItem::setShowProfileBtn(bool show)
{
// Already done? Then do nothing.
if(mShowProfileBtn == show)
return;
mShowProfileBtn = show;
S32 width_delta = show ? - mProfileBtnWidth : mProfileBtnWidth;
//Translating speaking indicator
mSpeakingIndicator->translate(width_delta, 0);
//Reshaping avatar name
mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight());
}
void LLAvatarListItem::setAvatarIconVisible(bool visible)
{
// Already done? Then do nothing.
......@@ -213,7 +241,7 @@ void LLAvatarListItem::setAvatarIconVisible(bool visible)
// Move the avatar name horizontally by icon size + its distance from the avatar name.
LLRect name_rect = mAvatarName->getRect();
name_rect.mLeft += visible ? sIconWidth : -sIconWidth;
name_rect.mLeft += visible ? mIconWidth : -mIconWidth;
mAvatarName->setRect(name_rect);
}
......
......@@ -64,6 +64,9 @@ class LLAvatarListItem : public LLPanel, public LLFriendObserver
void setName(const std::string& name);
void setAvatarId(const LLUUID& id, bool ignore_status_changes = false);
void setLastInteractionTime(const std::string& val);
//Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly
void setShowProfileBtn(bool hide);
void setShowInfoBtn(bool hide);
void setAvatarIconVisible(bool visible);
const LLUUID& getAvatarId() const;
......@@ -99,7 +102,13 @@ class LLAvatarListItem : public LLPanel, public LLFriendObserver
LLUUID mAvatarId;
EOnlineStatus mOnlineStatus;
static S32 sIconWidth; // icon width + padding
//Flag indicating that info/profile button shouldn't be shown at all.
//Speaker indicator and avatar name coords are translated accordingly
bool mShowInfoBtn;
bool mShowProfileBtn;
S32 mIconWidth; // icon width + padding
S32 mInfoBtnWidth; //info btn width + padding
S32 mProfileBtnWidth; //profile btn width + padding
};
#endif //LL_LLAVATARLISTITEM_H
......@@ -54,6 +54,7 @@
#include "llaccordionctrltab.h"
#include "llagent.h"
#include "llagentui.h"
#include "llappviewer.h"
#include "llavatarpropertiesprocessor.h"
#include "llcallbacklist.h"
#include "llexpandabletextbox.h"
......@@ -1003,13 +1004,15 @@ void LLPanelPlaceInfo::updateYouAreHereBanner(void* userdata)
LLPanelPlaceInfo* self = static_cast<LLPanelPlaceInfo*>(userdata);
if(!self->getVisible())
return;
if(!gDisconnected)
{
static F32 radius = gSavedSettings.getF32("YouAreHereDistance");
static F32 radius = gSavedSettings.getF32("YouAreHereDistance");
BOOL display_banner = self->mLastSelectedRegionID == gAgent.getRegion()->getRegionID() &&
BOOL display_banner = gAgent.getRegion()->getRegionID() == self->mLastSelectedRegionID &&
LLAgentUI::checkAgentDistance(self->mPosRegion, radius);
self->mYouAreHerePanel->setVisible(display_banner);
self->mYouAreHerePanel->setVisible(display_banner);
}
}
void LLPanelPlaceInfo::onForSaleBannerClick()
......
......@@ -13,6 +13,8 @@
left="3"
name="speakers_list"
opaque="false"
show_info_btn="false"
show_profile_btn="false"
top="10"
width="140" />
<button
......
......@@ -13,6 +13,8 @@
left="3"
name="speakers_list"
opaque="false"
show_info_btn="false"
show_profile_btn="false"
top="10"
width="140" />
<button
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment