Skip to content
Snippets Groups Projects
Unverified Commit 683e96ed authored by Maxim Nikolenko's avatar Maxim Nikolenko Committed by GitHub
Browse files

SL-20380 Add group notices button as hover button on Groups floater

parent b2fde094
No related branches found
No related tags found
No related merge requests found
...@@ -936,3 +936,20 @@ S32 LLAccordionCtrl::calcExpandedTabHeight(S32 tab_index /* = 0 */, S32 availabl ...@@ -936,3 +936,20 @@ S32 LLAccordionCtrl::calcExpandedTabHeight(S32 tab_index /* = 0 */, S32 availabl
expanded_tab_height /= num_expanded; expanded_tab_height /= num_expanded;
return expanded_tab_height; 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();
}
}
...@@ -122,6 +122,8 @@ class LLAccordionCtrl: public LLPanel ...@@ -122,6 +122,8 @@ class LLAccordionCtrl: public LLPanel
void setComparator(const LLTabComparator* comp) { mTabComparator = comp; } void setComparator(const LLTabComparator* comp) { mTabComparator = comp; }
void sort(); void sort();
void collapseAllTabs();
/** /**
* Sets filter substring as a search_term for help text when there are no any visible tabs. * Sets filter substring as a search_term for help text when there are no any visible tabs.
*/ */
......
...@@ -398,7 +398,7 @@ void LLGroupActions::inspect(const LLUUID& group_id) ...@@ -398,7 +398,7 @@ void LLGroupActions::inspect(const LLUUID& group_id)
} }
// static // static
void LLGroupActions::show(const LLUUID& group_id) void LLGroupActions::show(const LLUUID &group_id, bool expand_notices_tab)
{ {
if (group_id.isNull()) if (group_id.isNull())
return; return;
...@@ -406,6 +406,10 @@ void LLGroupActions::show(const LLUUID& group_id) ...@@ -406,6 +406,10 @@ void LLGroupActions::show(const LLUUID& group_id)
LLSD params; LLSD params;
params["group_id"] = group_id; params["group_id"] = group_id;
params["open_tab_name"] = "panel_group_info_sidetray"; params["open_tab_name"] = "panel_group_info_sidetray";
if (expand_notices_tab)
{
params["action"] = "show_notices";
}
LLFloaterSidePanelContainer::showPanel("people", "panel_group_info_sidetray", params); LLFloaterSidePanelContainer::showPanel("people", "panel_group_info_sidetray", params);
LLFloater *floater = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>("people"); LLFloater *floater = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>("people");
......
...@@ -57,7 +57,7 @@ class LLGroupActions ...@@ -57,7 +57,7 @@ class LLGroupActions
/** /**
* Show group information panel. * 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. * Show group inspector floater.
......
...@@ -303,6 +303,7 @@ void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LL ...@@ -303,6 +303,7 @@ void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LL
item->getChildView("info_btn")->setVisible( false); item->getChildView("info_btn")->setVisible( false);
item->getChildView("profile_btn")->setVisible( false); item->getChildView("profile_btn")->setVisible( false);
item->getChildView("notices_btn")->setVisible(false);
item->setGroupIconVisible(mShowIcons); item->setGroupIconVisible(mShowIcons);
if (!mShowIcons) if (!mShowIcons)
{ {
...@@ -403,6 +404,7 @@ mGroupIcon(NULL), ...@@ -403,6 +404,7 @@ mGroupIcon(NULL),
mGroupNameBox(NULL), mGroupNameBox(NULL),
mInfoBtn(NULL), mInfoBtn(NULL),
mProfileBtn(NULL), mProfileBtn(NULL),
mNoticesBtn(NULL),
mVisibilityHideBtn(NULL), mVisibilityHideBtn(NULL),
mVisibilityShowBtn(NULL), mVisibilityShowBtn(NULL),
mGroupID(LLUUID::null), mGroupID(LLUUID::null),
...@@ -435,6 +437,9 @@ BOOL LLGroupListItem::postBuild() ...@@ -435,6 +437,9 @@ BOOL LLGroupListItem::postBuild()
mProfileBtn = getChild<LLButton>("profile_btn"); mProfileBtn = getChild<LLButton>("profile_btn");
mProfileBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onProfileBtnClick(); }); mProfileBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onProfileBtnClick(); });
mNoticesBtn = getChild<LLButton>("notices_btn");
mNoticesBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onNoticesBtnClick(); });
mVisibilityHideBtn = findChild<LLButton>("visibility_hide_btn"); mVisibilityHideBtn = findChild<LLButton>("visibility_hide_btn");
if (mVisibilityHideBtn) if (mVisibilityHideBtn)
{ {
...@@ -470,6 +475,7 @@ void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask) ...@@ -470,6 +475,7 @@ void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask)
{ {
mInfoBtn->setVisible(true); mInfoBtn->setVisible(true);
mProfileBtn->setVisible(true); mProfileBtn->setVisible(true);
mNoticesBtn->setVisible(true);
if (mForAgent && mVisibilityHideBtn) if (mForAgent && mVisibilityHideBtn)
{ {
LLGroupData agent_gdatap; LLGroupData agent_gdatap;
...@@ -489,6 +495,7 @@ void LLGroupListItem::onMouseLeave(S32 x, S32 y, MASK mask) ...@@ -489,6 +495,7 @@ void LLGroupListItem::onMouseLeave(S32 x, S32 y, MASK mask)
getChildView("hovered_icon")->setVisible( false); getChildView("hovered_icon")->setVisible( false);
mInfoBtn->setVisible(false); mInfoBtn->setVisible(false);
mProfileBtn->setVisible(false); mProfileBtn->setVisible(false);
mNoticesBtn->setVisible(false);
if (mVisibilityHideBtn) if (mVisibilityHideBtn)
{ {
mVisibilityHideBtn->setVisible(false); mVisibilityHideBtn->setVisible(false);
...@@ -583,6 +590,11 @@ void LLGroupListItem::onProfileBtnClick() ...@@ -583,6 +590,11 @@ void LLGroupListItem::onProfileBtnClick()
LLGroupActions::show(mGroupID); LLGroupActions::show(mGroupID);
} }
void LLGroupListItem::onNoticesBtnClick()
{
LLGroupActions::show(mGroupID, true);
}
void LLGroupListItem::onVisibilityBtnClick(bool new_visibility) void LLGroupListItem::onVisibilityBtnClick(bool new_visibility)
{ {
LLGroupData agent_gdatap; LLGroupData agent_gdatap;
......
...@@ -123,6 +123,7 @@ class LLGroupListItem : public LLPanel ...@@ -123,6 +123,7 @@ class LLGroupListItem : public LLPanel
void setBold(bool bold); void setBold(bool bold);
void onInfoBtnClick(); void onInfoBtnClick();
void onProfileBtnClick(); void onProfileBtnClick();
void onNoticesBtnClick();
void onVisibilityBtnClick(bool new_visibility); void onVisibilityBtnClick(bool new_visibility);
LLTextBox* mGroupNameBox; LLTextBox* mGroupNameBox;
...@@ -130,6 +131,7 @@ class LLGroupListItem : public LLPanel ...@@ -130,6 +131,7 @@ class LLGroupListItem : public LLPanel
LLGroupIconCtrl* mGroupIcon; LLGroupIconCtrl* mGroupIcon;
LLButton* mInfoBtn; LLButton* mInfoBtn;
LLButton* mProfileBtn; LLButton* mProfileBtn;
LLButton* mNoticesBtn;
LLButton* mVisibilityHideBtn; LLButton* mVisibilityHideBtn;
LLButton* mVisibilityShowBtn; LLButton* mVisibilityShowBtn;
......
...@@ -134,6 +134,15 @@ void LLPanelGroup::onOpen(const LLSD& key) ...@@ -134,6 +134,15 @@ void LLPanelGroup::onOpen(const LLSD& key)
if(panel_notices) if(panel_notices)
panel_notices->refreshNotices(); panel_notices->refreshNotices();
} }
if (str_action == "show_notices")
{
setGroupID(group_id);
LLAccordionCtrl *tab_ctrl = getChild<LLAccordionCtrl>("groups_accordion");
tab_ctrl->collapseAllTabs();
getChild<LLAccordionCtrlTab>("group_notices_tab")->setDisplayChildren(true);
tab_ctrl->arrange();
}
} }
......
indra/newview/skins/default/textures/icons/Group_Notices.png

3.42 KiB

...@@ -239,6 +239,8 @@ with the same filename but different name ...@@ -239,6 +239,8 @@ with the same filename but different name
<texture name="Generic_Person" file_name="icons/Generic_Person.png" preload="false" /> <texture name="Generic_Person" file_name="icons/Generic_Person.png" preload="false" />
<texture name="Generic_Person_Large" file_name="icons/Generic_Person_Large.png" preload="false" /> <texture name="Generic_Person_Large" file_name="icons/Generic_Person_Large.png" preload="false" />
<texture name="Group_Notices" file_name="icons/Group_Notices.png" preload="false" />
<texture name="Hand" file_name="icons/hand.png" preload="false" /> <texture name="Hand" file_name="icons/hand.png" preload="false" />
<texture name="Help_Press" file_name="navbar/Help_Press.png" preload="false" /> <texture name="Help_Press" file_name="navbar/Help_Press.png" preload="false" />
......
...@@ -48,6 +48,18 @@ ...@@ -48,6 +48,18 @@
use_ellipses="true" use_ellipses="true"
value="Unknown" value="Unknown"
width="242" /> width="242" />
<button
name="notices_btn"
tool_tip="Group Notices"
top_delta="-4"
left_pad="3"
right="-53"
height="20"
width="20"
follows="right"
image_pressed="Group_Notices"
image_unselected="Group_Notices"
tab_stop="false"/>
<button <button
follows="right" follows="right"
height="16" height="16"
...@@ -58,7 +70,7 @@ ...@@ -58,7 +70,7 @@
name="info_btn" name="info_btn"
tool_tip="More info" tool_tip="More info"
tab_stop="false" tab_stop="false"
top_delta="-2" top_delta="2"
width="16" /> width="16" />
<!--*TODO: Should only appear on rollover--> <!--*TODO: Should only appear on rollover-->
<button <button
...@@ -71,6 +83,6 @@ ...@@ -71,6 +83,6 @@
name="profile_btn" name="profile_btn"
tab_stop="false" tab_stop="false"
tool_tip="View profile" tool_tip="View profile"
top_delta="-2" top_delta="0"
width="20" /> width="20" />
</panel> </panel>
...@@ -53,10 +53,22 @@ ...@@ -53,10 +53,22 @@
text_color="ScrollUnselectedColor" text_color="ScrollUnselectedColor"
use_ellipses="true" use_ellipses="true"
/> />
<button
name="notices_btn"
tool_tip="Group Notices"
top_delta="-4"
left_pad="3"
right="-80"
height="20"
width="20"
follows="right"
image_pressed="Group_Notices"
image_unselected="Group_Notices"
tab_stop="false"/>
<button <button
name="visibility_hide_btn" name="visibility_hide_btn"
tool_tip="Hide group on my profile" tool_tip="Hide group on my profile"
top_delta="-3" top_delta="0"
left_pad="3" left_pad="3"
right="-53" right="-53"
height="20" height="20"
......
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