From f15ad900e45bef02783f209e5b8ba5137447ab27 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 24 May 2022 00:15:51 +0300 Subject: SL-15312 Added new group visibility icons --- indra/newview/llgrouplist.cpp | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'indra/newview/llgrouplist.cpp') diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 9c1c32d573..38c0b64e0a 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -401,7 +401,8 @@ mGroupIcon(NULL), mGroupNameBox(NULL), mInfoBtn(NULL), mProfileBtn(NULL), -mVisibilityBtn(NULL), +mVisibilityHideBtn(NULL), +mVisibilityShowBtn(NULL), mGroupID(LLUUID::null), mForAgent(for_agent) { @@ -439,10 +440,15 @@ BOOL LLGroupListItem::postBuild() mProfileBtn = getChild("profile_btn"); mProfileBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onProfileBtnClick(); }); - mVisibilityBtn = findChild("visibility_btn"); - if (mVisibilityBtn) + mVisibilityHideBtn = findChild("visibility_hide_btn"); + if (mVisibilityHideBtn) { - mVisibilityBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onVisibilityBtnClick(); }); + mVisibilityHideBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onVisibilityBtnClick(false); }); + } + mVisibilityShowBtn = findChild("visibility_show_btn"); + if (mVisibilityShowBtn) + { + mVisibilityShowBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onVisibilityBtnClick(true); }); } return TRUE; @@ -463,9 +469,14 @@ void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask) { mInfoBtn->setVisible(true); mProfileBtn->setVisible(true); - if (mForAgent && mVisibilityBtn) + if (mForAgent && mVisibilityHideBtn) { - mVisibilityBtn->setVisible(true); + LLGroupData agent_gdatap; + if (gAgent.getGroupData(mGroupID, agent_gdatap)) + { + mVisibilityHideBtn->setVisible(agent_gdatap.mListInProfile); + mVisibilityShowBtn->setVisible(!agent_gdatap.mListInProfile); + } } } @@ -477,9 +488,10 @@ void LLGroupListItem::onMouseLeave(S32 x, S32 y, MASK mask) getChildView("hovered_icon")->setVisible( false); mInfoBtn->setVisible(false); mProfileBtn->setVisible(false); - if (mVisibilityBtn) + if (mVisibilityHideBtn) { - mVisibilityBtn->setVisible(false); + mVisibilityHideBtn->setVisible(false); + mVisibilityShowBtn->setVisible(false); } LLPanel::onMouseLeave(x, y, mask); @@ -570,14 +582,15 @@ void LLGroupListItem::onProfileBtnClick() LLGroupActions::show(mGroupID); } -void LLGroupListItem::onVisibilityBtnClick() +void LLGroupListItem::onVisibilityBtnClick(bool new_visibility) { LLGroupData agent_gdatap; if (gAgent.getGroupData(mGroupID, agent_gdatap)) { - bool new_visibility = !agent_gdatap.mListInProfile; gAgent.setUserGroupFlags(mGroupID, agent_gdatap.mAcceptNotices, new_visibility); setVisibleInProfile(new_visibility); + mVisibilityHideBtn->setVisible(new_visibility); + mVisibilityShowBtn->setVisible(!new_visibility); } } -- cgit v1.2.3