SL-10804 [Legacy Profiles] Second Life tab block button size and focus

master
andreykproductengine 2019-03-25 17:19:11 +02:00
parent e0b24ee960
commit 458d318aeb
5 changed files with 22 additions and 9 deletions

View File

@ -1076,7 +1076,7 @@ bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NUL
}
// static
void LLAvatarActions::toggleBlock(const LLUUID& id)
bool LLAvatarActions::toggleBlock(const LLUUID& id)
{
LLAvatarName av_name;
LLAvatarNameCache::get(id, &av_name);
@ -1086,10 +1086,12 @@ void LLAvatarActions::toggleBlock(const LLUUID& id)
if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName))
{
LLMuteList::getInstance()->remove(mute);
return false;
}
else
{
LLMuteList::getInstance()->add(mute);
return true;
}
}

View File

@ -134,9 +134,10 @@ public:
static void shareWithAvatars(LLView * panel);
/**
* Block/unblock the avatar.
* Block/unblock the avatar by id.
* Returns true if blocked, returns false if unblocked
*/
static void toggleBlock(const LLUUID& id);
static bool toggleBlock(const LLUUID& id);
/**
* Mute/unmute avatar.

View File

@ -276,8 +276,8 @@ BOOL LLPanelProfileSecondLife::postBuild()
mTeleportButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onTeleportButtonClick, this));
mShowOnMapButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onMapButtonClick, this));
mPayButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::pay, this));
mBlockButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::toggleBlock,this));
mUnblockButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::toggleBlock,this));
mBlockButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onClickToggleBlock, this));
mUnblockButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onClickToggleBlock, this));
mGroupInviteButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onGroupInvite,this));
mDisplayNameButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onClickSetName, this));
@ -519,11 +519,20 @@ void LLPanelProfileSecondLife::pay()
LLAvatarActions::pay(getAvatarId());
}
void LLPanelProfileSecondLife::toggleBlock()
void LLPanelProfileSecondLife::onClickToggleBlock()
{
LLAvatarActions::toggleBlock(getAvatarId());
bool blocked = LLAvatarActions::toggleBlock(getAvatarId());
updateButtons();
// we are hiding one button and showing another, set focus
if (blocked)
{
mUnblockButton->setFocus(true);
}
else
{
mBlockButton->setFocus(true);
}
}
void LLPanelProfileSecondLife::onAddFriendButtonClick()

View File

@ -138,8 +138,9 @@ protected:
/**
* Add/remove resident to/from your block list.
* Updates button focus
*/
void toggleBlock();
void onClickToggleBlock();
void onAddFriendButtonClick();
void onIMButtonClick();

View File

@ -438,7 +438,7 @@
label="Unblock"
tool_tip="Unblock this Resident"
top_delta="0"
right="-40"
height="20"
follows="left|top|right"
layout="topleft"
/>