From 26ee1cc148223b26ee1bdef61f4840410c4ab22f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 12 May 2022 23:44:47 +0300 Subject: SL-15312 New group visibility toggle. --- indra/newview/llgrouplist.cpp | 28 ++++++++++++++++++--- indra/newview/llgrouplist.h | 5 +++- .../icons/Profile_Search_Visibility_Dark.png | Bin 0 -> 368 bytes .../icons/Profile_Search_Visibility_Light.png | Bin 0 -> 366 bytes indra/newview/skins/default/textures/textures.xml | 3 +++ .../skins/default/xui/en/floater_display_name.xml | 2 +- .../default/xui/en/panel_group_list_item_short.xml | 18 +++++++++++-- 7 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Profile_Search_Visibility_Dark.png create mode 100644 indra/newview/skins/default/textures/icons/Profile_Search_Visibility_Light.png diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 8bc37f1fe4..ce48ecad63 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -400,6 +400,8 @@ LLGroupListItem::LLGroupListItem(bool for_agent, bool show_icons) mGroupIcon(NULL), mGroupNameBox(NULL), mInfoBtn(NULL), +mProfileBtn(NULL), +mVisibilityBtn(NULL), mGroupID(LLUUID::null), mForAgent(for_agent) { @@ -434,7 +436,11 @@ BOOL LLGroupListItem::postBuild() mInfoBtn = getChild("info_btn"); mInfoBtn->setClickedCallback(boost::bind(&LLGroupListItem::onInfoBtnClick, this)); - childSetAction("profile_btn", boost::bind(&LLGroupListItem::onProfileBtnClick, this)); + mProfileBtn = getChild("profile_btn"); + mProfileBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onProfileBtnClick(); }); + + mVisibilityBtn = getChild("visibility_btn"); + mVisibilityBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onVisibilityBtnClick(); }); return TRUE; } @@ -453,7 +459,11 @@ void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask) if (mGroupID.notNull()) // don't show the info button for the "none" group { mInfoBtn->setVisible(true); - getChildView("profile_btn")->setVisible( true); + mProfileBtn->setVisible(true); + if (mForAgent) + { + mVisibilityBtn->setVisible(true); + } } LLPanel::onMouseEnter(x, y, mask); @@ -463,7 +473,8 @@ void LLGroupListItem::onMouseLeave(S32 x, S32 y, MASK mask) { getChildView("hovered_icon")->setVisible( false); mInfoBtn->setVisible(false); - getChildView("profile_btn")->setVisible( false); + mVisibilityBtn->setVisible(false); + mProfileBtn->setVisible(false); LLPanel::onMouseLeave(x, y, mask); } @@ -553,6 +564,17 @@ void LLGroupListItem::onProfileBtnClick() LLGroupActions::show(mGroupID); } +void LLGroupListItem::onVisibilityBtnClick() +{ + 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); + } +} + void LLGroupListItem::changed(LLGroupChange gc) { LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mID); diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h index a85e20d819..5d4bb7bed2 100644 --- a/indra/newview/llgrouplist.h +++ b/indra/newview/llgrouplist.h @@ -123,11 +123,14 @@ private: void setBold(bool bold); void onInfoBtnClick(); void onProfileBtnClick(); + void onVisibilityBtnClick(); LLTextBox* mGroupNameBox; LLUUID mGroupID; LLGroupIconCtrl* mGroupIcon; - LLButton* mInfoBtn; + LLButton* mInfoBtn; + LLButton* mProfileBtn; + LLButton* mVisibilityBtn; std::string mGroupName; bool mForAgent; diff --git a/indra/newview/skins/default/textures/icons/Profile_Search_Visibility_Dark.png b/indra/newview/skins/default/textures/icons/Profile_Search_Visibility_Dark.png new file mode 100644 index 0000000000..09e627861c Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Profile_Search_Visibility_Dark.png differ diff --git a/indra/newview/skins/default/textures/icons/Profile_Search_Visibility_Light.png b/indra/newview/skins/default/textures/icons/Profile_Search_Visibility_Light.png new file mode 100644 index 0000000000..1a5aa63727 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Profile_Search_Visibility_Light.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index bbf3484595..c02bef3a45 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -506,6 +506,9 @@ with the same filename but different name + + + diff --git a/indra/newview/skins/default/xui/en/floater_display_name.xml b/indra/newview/skins/default/xui/en/floater_display_name.xml index d14b4a1699..3c8f415860 100644 --- a/indra/newview/skins/default/xui/en/floater_display_name.xml +++ b/indra/newview/skins/default/xui/en/floater_display_name.xml @@ -23,7 +23,7 @@ use_ellipses="true" width="380" wrap="true"> - The name you give your avatar is called your Display Name. You can change it once a week. + Your display name is what other people see above your head. It is different from your login name. You can change it once a week. +