A Name List that's double clicked should open a profile

Unless other behavior already exists, name lists aren't all scroll lists,
void where prohibited, other restrictions may apply.
This commit is contained in:
Liru Færs
2019-08-25 17:02:48 -04:00
parent a399bd7b62
commit 2c3e37024e
6 changed files with 21 additions and 45 deletions

View File

@@ -33,6 +33,8 @@
#include "llavatarnamecache.h"
#include "llcachename.h"
#include "llagent.h"
#include "llavataractions.h"
#include "llgroupactions.h"
#include "llinventory.h"
#include "llscrolllistitem.h"
#include "llscrolllistcolumn.h"
@@ -121,6 +123,24 @@ BOOL LLNameListCtrl::handleDragAndDrop(
return handled;
}
BOOL LLNameListCtrl::handleDoubleClick(S32 x, S32 y, MASK mask)
{
bool handled = LLScrollListCtrl::handleDoubleClick(x, y, mask);
if (!handled)
{
if (auto item = static_cast<LLNameListItem*>(hitItem(x, y)))
{
switch (item->getNameType())
{
case LLNameListItem::INDIVIDUAL: LLAvatarActions::showProfile(item->getValue()); break;
case LLNameListItem::GROUP: LLGroupActions::show(item->getValue()); break;
default: return false;
}
handled = true;
}
}
return handled;
}
// public
void LLNameListCtrl::addGroupNameItem(const LLUUID& group_id, EAddPosition pos,