VWR-29449; Route mouse events to the webbrowser (MOAP) on a HUD.
parent
217f4872f6
commit
efce6e6051
|
|
@ -313,12 +313,21 @@ void LLPanelPrimMediaControls::updateShape()
|
|||
|
||||
if (objectp)
|
||||
{
|
||||
// <FS:ND> VWR-29449; Remeber if user has MEDIA_PERM_CONTROL
|
||||
bool hasPermsControl = true;
|
||||
// </FS:ND>
|
||||
|
||||
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);
|
||||
|
||||
// <FS:ND> VWR-29449; Remeber if user has MEDIA_PERM_CONTROL
|
||||
hasPermsControl = dynamic_cast<LLVOVolume*>(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL);
|
||||
// </FS:ND>
|
||||
|
||||
mini_controls = (LLMediaEntry::MINI == media_data->getControls());
|
||||
}
|
||||
const bool is_hud = objectp->isHUDAttachment();
|
||||
|
|
@ -563,8 +572,36 @@ void LLPanelPrimMediaControls::updateShape()
|
|||
}
|
||||
}
|
||||
|
||||
setVisible(enabled);
|
||||
// <FS:ND> VWR-29449; 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, thus eg trying to sroll a webpage with mousewheel has surprising effects.
|
||||
|
||||
// setVisible(enabled);
|
||||
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);
|
||||
}
|
||||
|
||||
// </FS:ND>
|
||||
|
||||
//
|
||||
// Calculate position and shape of the controls
|
||||
//
|
||||
|
|
@ -765,10 +802,23 @@ 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);
|
||||
|
||||
// <FS:ND> VWR-29449; Only draw mBackgroundImage when the user has MEDIA_PERM_CONTROL. Otherwise we did hide all media controls above and drawing mBackgroundImage draws a useless grey square.
|
||||
|
||||
// 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);
|
||||
|
||||
// </FS:ND>
|
||||
|
||||
// draw volume slider background UI image
|
||||
if (mVolumeSliderCtrl->getVisible())
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue