summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/lltoggleablemenu.h2
-rw-r--r--indra/newview/llgrouplist.cpp4
-rw-r--r--indra/newview/llgrouplist.h9
-rw-r--r--indra/newview/llpanelpeople.cpp13
-rw-r--r--indra/newview/skins/default/xui/en/panel_people.xml2
5 files changed, 24 insertions, 6 deletions
diff --git a/indra/llui/lltoggleablemenu.h b/indra/llui/lltoggleablemenu.h
index 2094bd776f..dd9ac5b8c1 100644
--- a/indra/llui/lltoggleablemenu.h
+++ b/indra/llui/lltoggleablemenu.h
@@ -58,6 +58,8 @@ public:
// its visibility off.
bool toggleVisibility();
+ LLHandle<LLToggleableMenu> getHandle() { return getDerivedHandle<LLToggleableMenu>(); }
+
protected:
bool mClosedByButtonClick;
LLRect mButtonRect;
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index 129cddda45..2de891565c 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -86,7 +86,7 @@ LLGroupList::LLGroupList(const Params& p)
registrar.add("People.Groups.Action", boost::bind(&LLGroupList::onContextMenuItemClick, this, _2));
enable_registrar.add("People.Groups.Enable", boost::bind(&LLGroupList::onContextMenuItemEnable, this, _2));
- LLMenuGL* context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_people_groups.xml",
+ LLToggleableMenu* context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_people_groups.xml",
gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if(context_menu)
mContextMenuHandle = context_menu->getHandle();
@@ -112,7 +112,7 @@ BOOL LLGroupList::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask);
- LLMenuGL* context_menu = (LLMenuGL*)mContextMenuHandle.get();
+ LLToggleableMenu* context_menu = mContextMenuHandle.get();
if (context_menu && size() > 0)
{
context_menu->buildDrawLabels();
diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h
index 8abf14b3d0..6c8f4406ab 100644
--- a/indra/newview/llgrouplist.h
+++ b/indra/newview/llgrouplist.h
@@ -28,10 +28,13 @@
#define LL_LLGROUPLIST_H
#include "llevent.h"
+#include "llpointer.h"
+
#include "llflatlistview.h"
#include "llpanel.h"
-#include "llpointer.h"
#include "llstyle.h"
+#include "lltoggleablemenu.h"
+
#include "llgroupmgr.h"
/**
@@ -57,6 +60,8 @@ public:
void toggleIcons();
bool getIconsVisible() const { return mShowIcons; }
+ LLToggleableMenu* getContextMenu() const { return mContextMenuHandle.get(); }
+
private:
void setDirty(bool val = true) { mDirty = val; }
void refresh();
@@ -66,7 +71,7 @@ private:
bool onContextMenuItemClick(const LLSD& userdata);
bool onContextMenuItemEnable(const LLSD& userdata);
- LLHandle<LLView> mContextMenuHandle;
+ LLHandle<LLToggleableMenu> mContextMenuHandle;
bool mShowIcons;
bool mDirty;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 9b06d05b4b..260de40eef 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -630,6 +630,19 @@ BOOL LLPanelPeople::postBuild()
mGroupList->setCommitCallback(boost::bind(&LLPanelPeople::updateButtons, this));
mGroupList->setReturnCallback(boost::bind(&LLPanelPeople::onChatButtonClicked, this));
+ LLMenuButton* groups_gear_btn = getChild<LLMenuButton>("groups_gear_btn");
+
+ // Use the context menu of the Groups list for the Groups tab gear menu.
+ LLToggleableMenu* groups_gear_menu = mGroupList->getContextMenu();
+ if (groups_gear_menu)
+ {
+ groups_gear_btn->setMenu(groups_gear_menu, LLMenuButton::MP_BOTTOM_LEFT);
+ }
+ else
+ {
+ llwarns << "People->Groups list menu not found" << llendl;
+ }
+
LLAccordionCtrlTab* accordion_tab = getChild<LLAccordionCtrlTab>("tab_all");
accordion_tab->setDropDownStateChangedCallback(
boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _1, _2, mAllFriendList));
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index abfb9c7a36..ceb03d03a9 100644
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -418,8 +418,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
image_unselected="Toolbar_Middle_Off"
layout="topleft"
left_pad="8"
- menu_filename="menu_people_groups.xml"
- menu_position="bottomleft"
name="groups_gear_btn"
top="3"
width="31" />