diff options
author | James Cook <james@lindenlab.com> | 2009-07-21 19:00:58 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-07-21 19:00:58 +0000 |
commit | 9ad6434bb7a3fdced7d9095a4c788a22b7bf028a (patch) | |
tree | 7205b05943817946cfaeff15459aa20f016811e8 /indra/newview | |
parent | cef46d16453873691406c22be39ce0ee5e8076d1 (diff) |
DEV-34977 Context menu fails to open in Build mode. Product Engine implemented context menus as spawning on right-mouse-up, which interacts poorly with LLToolPie and recycled pie menu code. Changed context menu spawn to right-mouse-down, which allows click-drag-select behavior like the Mac. Eliminated unnecessary LLContextMenu::handleMouseUp and handleMouseDown methods -- these are handled in the LLMenuGL base class. Added handleRightMouseUp to LLMenuHolderGL to hide menus on right-mouse-up outside the menu. Reviewed with Richard.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lltoolpie.cpp | 14 | ||||
-rw-r--r-- | indra/newview/lltoolpie.h | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index c71ed5ae47..a937f156e8 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -102,15 +102,19 @@ void LLToolPie::leftMouseCallback(const LLPickInfo& pick_info) LLToolPie::getInstance()->pickLeftMouseDownCallback(); } +// Spawn context menus on right mouse down so you can drag over and select +// an item. BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask) { + // don't pick transparent so users can't "pay" transparent objects + gViewerWindow->pickAsync(x, y, mask, rightMouseCallback, FALSE, TRUE); + // claim not handled so UI focus stays same return FALSE; } BOOL LLToolPie::handleRightMouseUp(S32 x, S32 y, MASK mask) { LLToolMgr::getInstance()->clearTransientTool(); - gViewerWindow->pickAsync(x, y, mask, rightMouseCallback, FALSE, TRUE); return LLTool::handleRightMouseUp(x, y, mask); } @@ -118,7 +122,7 @@ BOOL LLToolPie::handleRightMouseUp(S32 x, S32 y, MASK mask) void LLToolPie::rightMouseCallback(const LLPickInfo& pick_info) { LLToolPie::getInstance()->mPick = pick_info; - LLToolPie::getInstance()->pickRightMouseUpCallback(); + LLToolPie::getInstance()->pickRightMouseDownCallback(); } // True if you selected an object. @@ -729,8 +733,8 @@ static ECursorType cursor_from_parcel_media(U8 click_action) } -// True if you selected an object. -BOOL LLToolPie::pickRightMouseUpCallback() +// True if we handled the event. +BOOL LLToolPie::pickRightMouseDownCallback() { S32 x = mPick.mMousePt.mX; S32 y = mPick.mMousePt.mY; @@ -826,7 +830,7 @@ BOOL LLToolPie::pickRightMouseUpCallback() } } - LLTool::handleRightMouseUp(x, y, mask); + LLTool::handleRightMouseDown(x, y, mask); // We handled the event. return TRUE; } diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index 82de2b363e..d2437e813d 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -75,7 +75,7 @@ public: private: BOOL outsideSlop (S32 x, S32 y, S32 start_x, S32 start_y); BOOL pickLeftMouseDownCallback(); - BOOL pickRightMouseUpCallback(); + BOOL pickRightMouseDownCallback(); BOOL useClickAction (MASK mask, LLViewerObject* object,LLViewerObject* parent); void showVisualContextMenuEffect(); |