diff options
author | Merov Linden <merov@lindenlab.com> | 2013-02-04 14:43:20 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-02-04 14:43:20 -0800 |
commit | e5c593682af3a4958316d7747d39f41e2a65e88c (patch) | |
tree | 2c62627da1b826a4df17e5173cb5b1a8fd5ada5f /indra/newview/llavatarlist.cpp | |
parent | 3e73b107d37e293b4e4cde91734e1e8251ba6b72 (diff) | |
parent | 2f6ffe2183250f3f71a8d502eed9cf9df9ff8b16 (diff) |
Pull merge from lindenlab/viewer-chui
Diffstat (limited to 'indra/newview/llavatarlist.cpp')
-rw-r--r-- | indra/newview/llavatarlist.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index e54e47180f..9f02f301a1 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -46,6 +46,7 @@ #include "lluuid.h" #include "llvoiceclient.h" #include "llviewercontrol.h" // for gSavedSettings +#include "lltooldraganddrop.h" static LLDefaultChildRegistry::Register<LLAvatarList> r("avatar_list"); @@ -462,6 +463,57 @@ BOOL LLAvatarList::handleRightMouseDown(S32 x, S32 y, MASK mask) return handled; } +BOOL LLAvatarList::handleMouseDown(S32 x, S32 y, MASK mask) +{ + gFocusMgr.setMouseCapture(this); + + S32 screen_x; + S32 screen_y; + localPointToScreen(x, y, &screen_x, &screen_y); + LLToolDragAndDrop::getInstance()->setDragStart(screen_x, screen_y); + + return LLFlatListViewEx::handleMouseDown(x, y, mask); +} + +BOOL LLAvatarList::handleMouseUp( S32 x, S32 y, MASK mask ) +{ + if(hasMouseCapture()) + { + gFocusMgr.setMouseCapture(NULL); + } + + return LLFlatListViewEx::handleMouseUp(x, y, mask); +} + +BOOL LLAvatarList::handleHover(S32 x, S32 y, MASK mask) +{ + bool handled = hasMouseCapture(); + if(handled) + { + S32 screen_x; + S32 screen_y; + localPointToScreen(x, y, &screen_x, &screen_y); + + if(LLToolDragAndDrop::getInstance()->isOverThreshold(screen_x, screen_y)) + { + // First, create the global drag and drop object + std::vector<EDragAndDropType> types; + uuid_vec_t cargo_ids; + getSelectedUUIDs(cargo_ids); + types.resize(cargo_ids.size(), DAD_PERSON); + LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_PEOPLE; + LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src); + } + } + + if(!handled) + { + handled = LLFlatListViewEx::handleHover(x, y, mask); + } + + return handled; +} + bool LLAvatarList::isAvalineItemSelected() { std::vector<LLPanel*> selected_items; |