diff options
| author | Cho <cho@lindenlab.com> | 2013-02-01 18:54:15 +0000 |
|---|---|---|
| committer | Cho <cho@lindenlab.com> | 2013-02-01 18:54:15 +0000 |
| commit | 56b158e486f97f26c87ac37923f5dfbc2cc7548a (patch) | |
| tree | f29399d0d297573d5560a496ae1367436815656b /indra/newview/llavatarlist.cpp | |
| parent | 97930c72b6f869e9bb47cda7d9ecfccf1a25a3fa (diff) | |
CHUI-675 FIX You can select multiple users in people floater but can only drag and drop one name to conversation
Moved drag and drop start in LLAvatarListItem instead of LLAvatarList, and made LLFloaterIMSession handle multiple dropped participants correctly
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; |
