Make namebox an IDBearer, so now it has a right click menu, yay!

This commit is contained in:
Liru Færs
2019-10-07 23:47:35 -04:00
parent 8f3b10875e
commit 99facf6764
2 changed files with 19 additions and 0 deletions

View File

@@ -109,6 +109,19 @@ void LLNameBox::showProfile()
LLAvatarActions::showProfile(mNameID);
}
// virtual
BOOL LLNameBox::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
if (!LLTextBox::handleRightMouseDown(x, y, mask))
{
// Singu TODO: Generic menus for groups
if (mIsGroup || mNameID.isNull()) return FALSE;
showMenu(this, sMenus[0], x, y);
}
return TRUE;
}
// virtual
void LLNameBox::initFromXML(LLXMLNodePtr node, LLView* parent)
{

View File

@@ -35,6 +35,7 @@
#include <set>
#include "lfidbearer.h"
#include "llview.h"
#include "llstring.h"
#include "llfontgl.h"
@@ -42,12 +43,16 @@
class LLNameBox
: public LLTextBox
, public LFIDBearer
{
public:
virtual void initFromXML(LLXMLNodePtr node, LLView* parent);
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
virtual ~LLNameBox();
LLUUID getStringUUIDSelectedItem() const override final { return mNameID; }
uuid_vec_t getSelectedIDs() const override final { return {mNameID}; }
S32 getNumSelected() const override final { return 1; }
void setNameID(const LLUUID& name_id, BOOL is_group);
@@ -56,6 +61,7 @@ public:
static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group);
void showProfile();
BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override final;
protected:
LLNameBox(const std::string& name);