diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2018-08-24 02:40:12 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2018-08-24 02:40:12 +0300 |
commit | d965af2b0cbf62e2e1601f504e0d548da40aa742 (patch) | |
tree | adfb1d0dee87068dfe4e9bc1b7247ccec838a89d /indra/llui | |
parent | 94c24b8713b72b6ce52637644ff18b234a3a400a (diff) |
MAINT-9032 Virtual Track Ball improvements
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llvirtualtrackball.cpp | 31 | ||||
-rw-r--r-- | indra/llui/llvirtualtrackball.h | 5 |
2 files changed, 36 insertions, 0 deletions
diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp index e73bba57bb..723643dd25 100644 --- a/indra/llui/llvirtualtrackball.cpp +++ b/indra/llui/llvirtualtrackball.cpp @@ -88,6 +88,7 @@ LLVirtualTrackball::LLVirtualTrackball(const LLVirtualTrackball::Params& p) btn_rt.rect(LLRect(centerX - axis_offset_lt, border_rect.mTop, centerX + axis_offset_rb, border_rect.mTop - btn_size)); btn_rt.click_callback.function(boost::bind(&LLVirtualTrackball::onRotateTopClick, this)); btn_rt.mouse_held_callback.function(boost::bind(&LLVirtualTrackball::onRotateTopClick, this)); + btn_rt.mouseenter_callback.function(boost::bind(&LLVirtualTrackball::onRotateTopMouseEnter, this)); mBtnRotateTop = LLUICtrlFactory::create<LLButton>(btn_rt); addChild(mBtnRotateTop); @@ -104,6 +105,7 @@ LLVirtualTrackball::LLVirtualTrackball(const LLVirtualTrackball::Params& p) btn_rr.rect(LLRect(border_rect.mRight - btn_size, centerY + axis_offset_lt, border_rect.mRight, centerY - axis_offset_rb)); btn_rr.click_callback.function(boost::bind(&LLVirtualTrackball::onRotateRightClick, this)); btn_rr.mouse_held_callback.function(boost::bind(&LLVirtualTrackball::onRotateRightClick, this)); + btn_rr.mouseenter_callback.function(boost::bind(&LLVirtualTrackball::onRotateRightMouseEnter, this)); mBtnRotateRight = LLUICtrlFactory::create<LLButton>(btn_rr); addChild(mBtnRotateRight); @@ -120,6 +122,7 @@ LLVirtualTrackball::LLVirtualTrackball(const LLVirtualTrackball::Params& p) btn_rb.rect(LLRect(centerX - axis_offset_lt, border_rect.mBottom + btn_size, centerX + axis_offset_rb, border_rect.mBottom)); btn_rb.click_callback.function(boost::bind(&LLVirtualTrackball::onRotateBottomClick, this)); btn_rb.mouse_held_callback.function(boost::bind(&LLVirtualTrackball::onRotateBottomClick, this)); + btn_rb.mouseenter_callback.function(boost::bind(&LLVirtualTrackball::onRotateBottomMouseEnter, this)); mBtnRotateBottom = LLUICtrlFactory::create<LLButton>(btn_rb); addChild(mBtnRotateBottom); @@ -136,6 +139,7 @@ LLVirtualTrackball::LLVirtualTrackball(const LLVirtualTrackball::Params& p) btn_rl.rect(LLRect(border_rect.mLeft, centerY + axis_offset_lt, border_rect.mLeft + btn_size, centerY - axis_offset_rb)); btn_rl.click_callback.function(boost::bind(&LLVirtualTrackball::onRotateLeftClick, this)); btn_rl.mouse_held_callback.function(boost::bind(&LLVirtualTrackball::onRotateLeftClick, this)); + btn_rl.mouseenter_callback.function(boost::bind(&LLVirtualTrackball::onRotateLeftMouseEnter, this)); mBtnRotateLeft = LLUICtrlFactory::create<LLButton>(btn_rl); addChild(mBtnRotateLeft); @@ -228,6 +232,13 @@ void LLVirtualTrackball::draw() gl_circle_2d(draw_point.mV[VX], draw_point.mV[VY], mImgSunFront->getWidth() / 2, 12, false); } + // hide the direction labels when disabled + BOOL enabled = isInEnabledChain(); + mLabelN->setVisible(enabled); + mLabelE->setVisible(enabled); + mLabelS->setVisible(enabled); + mLabelW->setVisible(enabled); + LLView::draw(); } @@ -283,6 +294,26 @@ void LLVirtualTrackball::onRotateRightClick() } } +void LLVirtualTrackball::onRotateTopMouseEnter() +{ + mBtnRotateTop->setHighlight(true); +} + +void LLVirtualTrackball::onRotateBottomMouseEnter() +{ + mBtnRotateBottom->setHighlight(true); +} + +void LLVirtualTrackball::onRotateLeftMouseEnter() +{ + mBtnRotateLeft->setHighlight(true); +} + +void LLVirtualTrackball::onRotateRightMouseEnter() +{ + mBtnRotateRight->setHighlight(true); +} + void LLVirtualTrackball::setValue(const LLSD& value) { if (value.isArray() && value.size() == 4) diff --git a/indra/llui/llvirtualtrackball.h b/indra/llui/llvirtualtrackball.h index 48ddb7f4d9..2d4b1ece17 100644 --- a/indra/llui/llvirtualtrackball.h +++ b/indra/llui/llvirtualtrackball.h @@ -130,6 +130,11 @@ private: void onRotateLeftClick(); void onRotateRightClick(); + void onRotateTopMouseEnter(); + void onRotateBottomMouseEnter(); + void onRotateLeftMouseEnter(); + void onRotateRightMouseEnter(); + S32 mPrevX; S32 mPrevY; |