diff options
author | Paul Guslisty <pguslisty@productengine.com> | 2010-12-28 19:02:49 +0200 |
---|---|---|
committer | Paul Guslisty <pguslisty@productengine.com> | 2010-12-28 19:02:49 +0200 |
commit | f1fd558dddf43277e024cb918c371d94d0764910 (patch) | |
tree | cf56f9c084f73de4c1bd988efe5742052558fed2 /indra/newview/llpanelprimmediacontrols.cpp | |
parent | 76e70a0da6f8f1db50de6a26fb6845a3b561adea (diff) |
STORM-714 FIXED Webprim's control bar doesn't dissapear after switching to mouselook mode
- After switching to the mouse look mode hide control bar immediately, not fading it with timer
- Added signal for switching mouse look mode out just for convenience. It's not used in this fix.
Diffstat (limited to 'indra/newview/llpanelprimmediacontrols.cpp')
-rw-r--r-- | indra/newview/llpanelprimmediacontrols.cpp | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 8ae3553857..82ff6c3487 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -92,7 +92,8 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() : mZoomObjectID(LLUUID::null), mZoomObjectFace(0), mVolumeSliderVisible(0), - mWindowShade(NULL) + mWindowShade(NULL), + mHideImmediately(false) { mCommitCallbackRegistrar.add("MediaCtrl.Close", boost::bind(&LLPanelPrimMediaControls::onClickClose, this)); mCommitCallbackRegistrar.add("MediaCtrl.Back", boost::bind(&LLPanelPrimMediaControls::onClickBack, this)); @@ -207,6 +208,8 @@ BOOL LLPanelPrimMediaControls::postBuild() mMediaAddress->setFocusReceivedCallback(boost::bind(&LLPanelPrimMediaControls::onInputURL, _1, this )); + gAgent.setMouselookModeInCallback(boost::bind(&LLPanelPrimMediaControls::onMouselookModeIn, this)); + LLWindowShade::Params window_shade_params; window_shade_params.name = "window_shade"; @@ -722,26 +725,22 @@ void LLPanelPrimMediaControls::draw() } F32 alpha = getDrawContext().mAlpha; - if(mFadeTimer.getStarted()) + if(mHideImmediately) + { + //hide this panel + clearFaceOnFade(); + + mHideImmediately = false; + } + else if(mFadeTimer.getStarted()) { F32 time = mFadeTimer.getElapsedTimeF32(); alpha *= llmax(lerp(1.0, 0.0, time / mControlFadeTime), 0.0f); if(time >= mControlFadeTime) { - if(mClearFaceOnFade) - { - // Hiding this object makes scroll events go missing after it fades out - // (see DEV-41755 for a full description of the train wreck). - // Only hide the controls when we're untargeting. - setVisible(FALSE); - - mClearFaceOnFade = false; - mVolumeSliderVisible = 0; - mTargetImplID = LLUUID::null; - mTargetObjectID = LLUUID::null; - mTargetObjectFace = 0; - } + //hide this panel + clearFaceOnFade(); } } @@ -1319,6 +1318,30 @@ bool LLPanelPrimMediaControls::shouldVolumeSliderBeVisible() return mVolumeSliderVisible > 0; } + +void LLPanelPrimMediaControls::clearFaceOnFade() +{ + if(mClearFaceOnFade) + { + // Hiding this object makes scroll events go missing after it fades out + // (see DEV-41755 for a full description of the train wreck). + // Only hide the controls when we're untargeting. + setVisible(FALSE); + + mClearFaceOnFade = false; + mVolumeSliderVisible = 0; + mTargetImplID = LLUUID::null; + mTargetObjectID = LLUUID::null; + mTargetObjectFace = 0; + } +} + +void LLPanelPrimMediaControls::onMouselookModeIn() +{ + LLViewerMediaFocus::getInstance()->clearHover(); + mHideImmediately = true; +} + void LLPanelPrimMediaControls::showNotification(LLNotificationPtr notify) { delete mWindowShade; |