summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolpie.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-07-21 19:00:58 +0000
committerJames Cook <james@lindenlab.com>2009-07-21 19:00:58 +0000
commit9ad6434bb7a3fdced7d9095a4c788a22b7bf028a (patch)
tree7205b05943817946cfaeff15459aa20f016811e8 /indra/newview/lltoolpie.cpp
parentcef46d16453873691406c22be39ce0ee5e8076d1 (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/lltoolpie.cpp')
-rw-r--r--indra/newview/lltoolpie.cpp14
1 files changed, 9 insertions, 5 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;
}