summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2018-08-24 02:40:12 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2018-08-24 02:40:12 +0300
commitd965af2b0cbf62e2e1601f504e0d548da40aa742 (patch)
treeadfb1d0dee87068dfe4e9bc1b7247ccec838a89d
parent94c24b8713b72b6ce52637644ff18b234a3a400a (diff)
MAINT-9032 Virtual Track Ball improvements
-rw-r--r--indra/llui/llvirtualtrackball.cpp31
-rw-r--r--indra/llui/llvirtualtrackball.h5
-rw-r--r--indra/newview/skins/default/textures/textures.xml4
-rw-r--r--indra/newview/skins/default/textures/widgets/track_control_rotate_bottom_active.pngbin0 -> 362 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/track_control_rotate_left_side_active.pngbin0 -> 340 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/track_control_rotate_right_side_active.pngbin0 -> 358 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/track_control_rotate_top_active.pngbin0 -> 367 bytes
-rw-r--r--indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml16
8 files changed, 48 insertions, 8 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;
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index a177dbadd5..176fbd49e9 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -695,6 +695,10 @@ with the same filename but different name
<texture name="VirtualTrackball_Rotate_Left" file_name="widgets/track_control_rotate_left_side.png" />
<texture name="VirtualTrackball_Rotate_Right" file_name="widgets/track_control_rotate_right_side.png" />
<texture name="VirtualTrackball_Rotate_Top" file_name="widgets/track_control_rotate_top.png" />
+ <texture name="VirtualTrackball_Rotate_Bottom_Active" file_name="widgets/track_control_rotate_bottom_active.png" />
+ <texture name="VirtualTrackball_Rotate_Left_Active" file_name="widgets/track_control_rotate_left_side_active.png" />
+ <texture name="VirtualTrackball_Rotate_Right_Active" file_name="widgets/track_control_rotate_right_side_active.png" />
+ <texture name="VirtualTrackball_Rotate_Top_Active" file_name="widgets/track_control_rotate_top_active.png" />
<texture name="VirtualTrackball_Sphere" file_name="widgets/track_control_sphere.png" />
<texture name="VirtualTrackball_Sun_Back" file_name="widgets/track_control_sun_back.png" />
<texture name="VirtualTrackball_Sun_Front" file_name="widgets/track_control_sun_front.png" />
diff --git a/indra/newview/skins/default/textures/widgets/track_control_rotate_bottom_active.png b/indra/newview/skins/default/textures/widgets/track_control_rotate_bottom_active.png
new file mode 100644
index 0000000000..911618b08e
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/track_control_rotate_bottom_active.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/track_control_rotate_left_side_active.png b/indra/newview/skins/default/textures/widgets/track_control_rotate_left_side_active.png
new file mode 100644
index 0000000000..2fe04b93f1
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/track_control_rotate_left_side_active.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/track_control_rotate_right_side_active.png b/indra/newview/skins/default/textures/widgets/track_control_rotate_right_side_active.png
new file mode 100644
index 0000000000..824051562f
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/track_control_rotate_right_side_active.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/track_control_rotate_top_active.png b/indra/newview/skins/default/textures/widgets/track_control_rotate_top_active.png
new file mode 100644
index 0000000000..9a7493703b
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/track_control_rotate_top_active.png
Binary files differ
diff --git a/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml b/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml
index 3a9655b317..0e729c821a 100644
--- a/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml
+++ b/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml
@@ -43,26 +43,26 @@
<sun_moon_trackball.button_rotate_top
name="btn_rotate_top"
image_unselected="VirtualTrackball_Rotate_Top"
- image_selected="VirtualTrackball_Rotate_Top"
- image_disabled="VirtualTrackball_Rotate_Top" />
+ image_selected="VirtualTrackball_Rotate_Top_Active"
+ image_disabled="Blank" />
<sun_moon_trackball.button_rotate_bottom
name="btn_rotate_bottom"
image_unselected="VirtualTrackball_Rotate_Bottom"
- image_selected="VirtualTrackball_Rotate_Bottom"
- image_disabled="VirtualTrackball_Rotate_Bottom" />
+ image_selected="VirtualTrackball_Rotate_Bottom_Active"
+ image_disabled="Blank" />
<sun_moon_trackball.button_rotate_left
name="btn_rotate_left"
image_unselected="VirtualTrackball_Rotate_Left"
- image_selected="VirtualTrackball_Rotate_Left"
- image_disabled="VirtualTrackball_Rotate_Left" />
+ image_selected="VirtualTrackball_Rotate_Left_Active"
+ image_disabled="Blank" />
<sun_moon_trackball.button_rotate_right
name="btn_rotate_right"
image_unselected="VirtualTrackball_Rotate_Right"
- image_selected="VirtualTrackball_Rotate_Right"
- image_disabled="VirtualTrackball_Rotate_Right" />
+ image_selected="VirtualTrackball_Rotate_Right_Active"
+ image_disabled="Blank" />
</sun_moon_trackball>