From 683e96ed61692d26b3eba2b08fe9978de998cb41 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 9 Oct 2023 12:35:53 +0300 Subject: SL-20380 Add group notices button as hover button on Groups floater --- indra/llui/llaccordionctrl.cpp | 17 +++++++++++++++++ indra/llui/llaccordionctrl.h | 2 ++ indra/newview/llgroupactions.cpp | 6 +++++- indra/newview/llgroupactions.h | 2 +- indra/newview/llgrouplist.cpp | 12 ++++++++++++ indra/newview/llgrouplist.h | 2 ++ indra/newview/llpanelgroup.cpp | 9 +++++++++ .../skins/default/textures/icons/Group_Notices.png | Bin 0 -> 3502 bytes indra/newview/skins/default/textures/textures.xml | 2 ++ .../skins/default/xui/en/panel_group_list_item.xml | 16 ++++++++++++++-- .../default/xui/en/panel_group_list_item_short.xml | 14 +++++++++++++- 11 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Group_Notices.png (limited to 'indra') diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 809d72208f..d0146910b6 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -936,3 +936,20 @@ S32 LLAccordionCtrl::calcExpandedTabHeight(S32 tab_index /* = 0 */, S32 availabl expanded_tab_height /= num_expanded; return expanded_tab_height; } + +void LLAccordionCtrl::collapseAllTabs() +{ + if (mAccordionTabs.size() > 0) + { + for (size_t i = 0; i < mAccordionTabs.size(); ++i) + { + LLAccordionCtrlTab *tab = mAccordionTabs[i]; + + if (tab->getDisplayChildren()) + { + tab->setDisplayChildren(false); + } + } + arrange(); + } +} diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index 2828254472..cc49ac8086 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -122,6 +122,8 @@ public: void setComparator(const LLTabComparator* comp) { mTabComparator = comp; } void sort(); + void collapseAllTabs(); + /** * Sets filter substring as a search_term for help text when there are no any visible tabs. */ diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index b588d6eaa1..5db8424b99 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -398,7 +398,7 @@ void LLGroupActions::inspect(const LLUUID& group_id) } // static -void LLGroupActions::show(const LLUUID& group_id) +void LLGroupActions::show(const LLUUID &group_id, bool expand_notices_tab) { if (group_id.isNull()) return; @@ -406,6 +406,10 @@ void LLGroupActions::show(const LLUUID& group_id) LLSD params; params["group_id"] = group_id; params["open_tab_name"] = "panel_group_info_sidetray"; + if (expand_notices_tab) + { + params["action"] = "show_notices"; + } LLFloaterSidePanelContainer::showPanel("people", "panel_group_info_sidetray", params); LLFloater *floater = LLFloaterReg::getTypedInstance("people"); diff --git a/indra/newview/llgroupactions.h b/indra/newview/llgroupactions.h index afc4686dd7..44513199c1 100644 --- a/indra/newview/llgroupactions.h +++ b/indra/newview/llgroupactions.h @@ -57,7 +57,7 @@ public: /** * Show group information panel. */ - static void show(const LLUUID& group_id); + static void show(const LLUUID& group_id, bool expand_notices_tab = false); /** * Show group inspector floater. diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 32af2592d3..d137440547 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -303,6 +303,7 @@ void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LL item->getChildView("info_btn")->setVisible( false); item->getChildView("profile_btn")->setVisible( false); + item->getChildView("notices_btn")->setVisible(false); item->setGroupIconVisible(mShowIcons); if (!mShowIcons) { @@ -403,6 +404,7 @@ mGroupIcon(NULL), mGroupNameBox(NULL), mInfoBtn(NULL), mProfileBtn(NULL), +mNoticesBtn(NULL), mVisibilityHideBtn(NULL), mVisibilityShowBtn(NULL), mGroupID(LLUUID::null), @@ -435,6 +437,9 @@ BOOL LLGroupListItem::postBuild() mProfileBtn = getChild("profile_btn"); mProfileBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onProfileBtnClick(); }); + mNoticesBtn = getChild("notices_btn"); + mNoticesBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onNoticesBtnClick(); }); + mVisibilityHideBtn = findChild("visibility_hide_btn"); if (mVisibilityHideBtn) { @@ -470,6 +475,7 @@ void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask) { mInfoBtn->setVisible(true); mProfileBtn->setVisible(true); + mNoticesBtn->setVisible(true); if (mForAgent && mVisibilityHideBtn) { LLGroupData agent_gdatap; @@ -489,6 +495,7 @@ void LLGroupListItem::onMouseLeave(S32 x, S32 y, MASK mask) getChildView("hovered_icon")->setVisible( false); mInfoBtn->setVisible(false); mProfileBtn->setVisible(false); + mNoticesBtn->setVisible(false); if (mVisibilityHideBtn) { mVisibilityHideBtn->setVisible(false); @@ -583,6 +590,11 @@ void LLGroupListItem::onProfileBtnClick() LLGroupActions::show(mGroupID); } +void LLGroupListItem::onNoticesBtnClick() +{ + LLGroupActions::show(mGroupID, true); +} + void LLGroupListItem::onVisibilityBtnClick(bool new_visibility) { LLGroupData agent_gdatap; diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h index 5cbabb712f..1bc2caff33 100644 --- a/indra/newview/llgrouplist.h +++ b/indra/newview/llgrouplist.h @@ -123,6 +123,7 @@ private: void setBold(bool bold); void onInfoBtnClick(); void onProfileBtnClick(); + void onNoticesBtnClick(); void onVisibilityBtnClick(bool new_visibility); LLTextBox* mGroupNameBox; @@ -130,6 +131,7 @@ private: LLGroupIconCtrl* mGroupIcon; LLButton* mInfoBtn; LLButton* mProfileBtn; + LLButton* mNoticesBtn; LLButton* mVisibilityHideBtn; LLButton* mVisibilityShowBtn; diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index ab255d5215..57742f16a7 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -134,6 +134,15 @@ void LLPanelGroup::onOpen(const LLSD& key) if(panel_notices) panel_notices->refreshNotices(); } + if (str_action == "show_notices") + { + setGroupID(group_id); + + LLAccordionCtrl *tab_ctrl = getChild("groups_accordion"); + tab_ctrl->collapseAllTabs(); + getChild("group_notices_tab")->setDisplayChildren(true); + tab_ctrl->arrange(); + } } diff --git a/indra/newview/skins/default/textures/icons/Group_Notices.png b/indra/newview/skins/default/textures/icons/Group_Notices.png new file mode 100644 index 0000000000..601502d374 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Group_Notices.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index aa99fe38cd..615816ed99 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -239,6 +239,8 @@ with the same filename but different name + + diff --git a/indra/newview/skins/default/xui/en/panel_group_list_item.xml b/indra/newview/skins/default/xui/en/panel_group_list_item.xml index e758a8ce30..c8b165e869 100644 --- a/indra/newview/skins/default/xui/en/panel_group_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_group_list_item.xml @@ -48,6 +48,18 @@ use_ellipses="true" value="Unknown" width="242" /> +