diff options
author | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2016-01-05 13:23:34 +0200 |
---|---|---|
committer | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2016-01-05 13:23:34 +0200 |
commit | 77156c2b15d86a15753ca00955ab5f29a9128eda (patch) | |
tree | 2b88347fe82bd4567997c815d9e27076b9bb4f2c /indra | |
parent | 2c19692c76306d794384d1e9a5c50eead3df0c0b (diff) |
MAINT-1392 HUD objects Behave Badly in conjunction with the Mouse Scroll Wheel
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llagentcamera.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llpanelprimmediacontrols.cpp | 41 |
2 files changed, 39 insertions, 4 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index aed27924fe..fa16f02c16 100755 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -879,7 +879,7 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction) } LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); - if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) + if (LLToolMgr::getInstance()->inBuildMode() && selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) { // just update hud zoom level mHUDTargetZoom /= fraction; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index f42df221e4..763657ebad 100755 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -314,12 +314,14 @@ void LLPanelPrimMediaControls::updateShape() if (objectp) { + bool hasPermsControl = true; bool mini_controls = false; LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); if (media_data && NULL != dynamic_cast<LLVOVolume*>(objectp)) { // Don't show the media controls if we do not have permissions enabled = dynamic_cast<LLVOVolume*>(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); + hasPermsControl = dynamic_cast<LLVOVolume*>(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); mini_controls = (LLMediaEntry::MINI == media_data->getControls()); } const bool is_hud = objectp->isHUDAttachment(); @@ -562,7 +564,32 @@ void LLPanelPrimMediaControls::updateShape() } } - setVisible(enabled); + // MAINT-1392 If this is a HUD always set it visible, but hide each control if user has no perms. + // When setting it invisible it won't receive any mouse messages anymore + + if( !is_hud ) + setVisible(enabled); + else + { + if( !hasPermsControl ) + { + mBackCtrl->setVisible(false); + mFwdCtrl->setVisible(false); + mReloadCtrl->setVisible(false); + mStopCtrl->setVisible(false); + mHomeCtrl->setVisible(false); + mZoomCtrl->setVisible(false); + mUnzoomCtrl->setVisible(false); + mOpenCtrl->setVisible(false); + mMediaAddressCtrl->setVisible(false); + mMediaPlaySliderPanel->setVisible(false); + mVolumeCtrl->setVisible(false); + mMediaProgressPanel->setVisible(false); + mVolumeSliderCtrl->setVisible(false); + } + + setVisible(true); + } // // Calculate position and shape of the controls @@ -767,10 +794,18 @@ void LLPanelPrimMediaControls::draw() // ignore space from right bookend padding controls_bg_area.mRight -= mRightBookend->getRect().getWidth() - space - 2; - + // draw control background UI image - mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha); + LLViewerObject* objectp = getTargetObject(); + LLMediaEntry *media_data(0); + + if( objectp ) + media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); + + if( !dynamic_cast<LLVOVolume*>(objectp) || !media_data || dynamic_cast<LLVOVolume*>(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL) ) + mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha); + // draw volume slider background UI image if (mVolumeSliderCtrl->getVisible()) { |