Skip to content
Snippets Groups Projects
Commit 61d550ee authored by Seth ProductEngine's avatar Seth ProductEngine
Browse files

CHUI-78 FIXED group actions gear menu in People->Groups.

Used the same menu for groups list context menu and gear menu in People->Groups.
Changed the type of groups list context menu to toggleable.
parent 4dffa335
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,8 @@ class LLToggleableMenu : public LLMenuGL
// its visibility off.
bool toggleVisibility();
LLHandle<LLToggleableMenu> getHandle() { return getDerivedHandle<LLToggleableMenu>(); }
protected:
bool mClosedByButtonClick;
LLRect mButtonRect;
......
......@@ -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();
......
......@@ -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 @@ class LLGroupList: public LLFlatListViewEx, public LLOldEvents::LLSimpleListener
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 @@ class LLGroupList: public LLFlatListViewEx, public LLOldEvents::LLSimpleListener
bool onContextMenuItemClick(const LLSD& userdata);
bool onContextMenuItemEnable(const LLSD& userdata);
LLHandle<LLView> mContextMenuHandle;
LLHandle<LLToggleableMenu> mContextMenuHandle;
bool mShowIcons;
bool mDirty;
......
......@@ -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));
......
......@@ -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" />
......
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