summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprimmediacontrols.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelprimmediacontrols.cpp')
-rwxr-xr-xindra/newview/llpanelprimmediacontrols.cpp41
1 files changed, 38 insertions, 3 deletions
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())
{