MAINT-9032 Virtual Track Ball improvements
parent
94c24b8713
commit
d965af2b0c
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -130,6 +130,11 @@ private:
|
|||
void onRotateLeftClick();
|
||||
void onRotateRightClick();
|
||||
|
||||
void onRotateTopMouseEnter();
|
||||
void onRotateBottomMouseEnter();
|
||||
void onRotateLeftMouseEnter();
|
||||
void onRotateRightMouseEnter();
|
||||
|
||||
S32 mPrevX;
|
||||
S32 mPrevY;
|
||||
|
||||
|
|
|
|||
|
|
@ -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" />
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 362 B |
Binary file not shown.
|
After Width: | Height: | Size: 340 B |
Binary file not shown.
|
After Width: | Height: | Size: 358 B |
Binary file not shown.
|
After Width: | Height: | Size: 367 B |
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue