diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2018-08-09 13:09:22 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2018-08-09 13:09:22 +0300 |
commit | 3dfd3be98e19c239949eb7d59ef3fb84274322d1 (patch) | |
tree | 95716b39642f376993bca3e3a9cd6f853fbd281a /indra | |
parent | 133900d31a4f75621bad070043f5ef0125708a88 (diff) |
MAINT-8900 LLVirtualTrackball improvements: buttons behavior and mode select
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llvirtualtrackball.cpp | 9 | ||||
-rw-r--r-- | indra/llui/llvirtualtrackball.h | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp index a24c5a420d..e73bba57bb 100644 --- a/indra/llui/llvirtualtrackball.cpp +++ b/indra/llui/llvirtualtrackball.cpp @@ -321,7 +321,7 @@ BOOL LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask) { if (hasMouseCapture()) { - if (mask == MASK_CONTROL) + if (mDragMode == DRAG_SCROLL) { // trackball (move to roll) mode LLQuaternion delta; @@ -394,7 +394,7 @@ BOOL LLVirtualTrackball::handleMouseUp(S32 x, S32 y, MASK mask) gFocusMgr.setMouseCapture(NULL); make_ui_sound("UISndClickRelease"); } - return TRUE; + return LLView::handleMouseUp(x, y, mask); } BOOL LLVirtualTrackball::handleMouseDown(S32 x, S32 y, MASK mask) @@ -404,9 +404,10 @@ BOOL LLVirtualTrackball::handleMouseDown(S32 x, S32 y, MASK mask) mPrevX = x; mPrevY = y; gFocusMgr.setMouseCapture(this); + mDragMode = (mask == MASK_CONTROL) ? DRAG_SCROLL : DRAG_SET; make_ui_sound("UISndClick"); } - return TRUE; + return LLView::handleMouseDown(x, y, mask); } BOOL LLVirtualTrackball::handleRightMouseDown(S32 x, S32 y, MASK mask) @@ -416,7 +417,7 @@ BOOL LLVirtualTrackball::handleRightMouseDown(S32 x, S32 y, MASK mask) //make_ui_sound("UISndClick"); } - return TRUE; + return LLView::handleRightMouseDown(x, y, mask); } BOOL LLVirtualTrackball::handleKeyHere(KEY key, MASK mask) diff --git a/indra/llui/llvirtualtrackball.h b/indra/llui/llvirtualtrackball.h index c1b66550bb..48ddb7f4d9 100644 --- a/indra/llui/llvirtualtrackball.h +++ b/indra/llui/llvirtualtrackball.h @@ -44,6 +44,11 @@ public: SUN, MOON }; + enum DragMode + { + DRAG_SET, + DRAG_SCROLL + }; struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> @@ -140,6 +145,7 @@ private: LLQuaternion mValue; ThumbMode mThumbMode; + DragMode mDragMode; F32 mIncrementMouse; F32 mIncrementBtn; |