From 45e9a060b4244b93720c0c21bd35f17199fbafd1 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 25 Nov 2009 10:40:26 -0800 Subject: DEV-41422 Show Home button and make Stop button remain enabled in time-based media controls --- indra/newview/llpanelprimmediacontrols.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'indra/newview/llpanelprimmediacontrols.cpp') diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 71c1b0cbb9..0ca2f0025c 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -332,13 +332,12 @@ void LLPanelPrimMediaControls::updateShape() if(media_plugin && media_plugin->pluginSupportsMediaTime()) { - mReloadCtrl->setEnabled(FALSE); - mReloadCtrl->setVisible(FALSE); + mReloadCtrl->setEnabled(false); + mReloadCtrl->setVisible(false); mMediaStopCtrl->setVisible(has_focus); - mHomeCtrl->setVisible(FALSE); - // No nav controls - mBackCtrl->setVisible(FALSE); - mFwdCtrl->setEnabled(FALSE); + mHomeCtrl->setVisible(has_focus); + mBackCtrl->setVisible(false); + mFwdCtrl->setVisible(false); mMediaAddressCtrl->setVisible(false); mMediaAddressCtrl->setEnabled(false); mMediaPlaySliderPanel->setVisible(has_focus && !mini_controls); @@ -416,7 +415,6 @@ void LLPanelPrimMediaControls::updateShape() mPlayCtrl->setVisible(FALSE); mPauseCtrl->setEnabled(TRUE); mPauseCtrl->setVisible(has_focus); - mMediaStopCtrl->setEnabled(TRUE); break; case LLPluginClassMediaOwner::MEDIA_PAUSED: @@ -425,7 +423,6 @@ void LLPanelPrimMediaControls::updateShape() mPauseCtrl->setVisible(FALSE); mPlayCtrl->setEnabled(TRUE); mPlayCtrl->setVisible(has_focus); - mMediaStopCtrl->setEnabled(FALSE); break; } } -- cgit v1.2.3 From 751a9049822ab39f1762ab6758cc3ee0aabb4a4b Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 25 Nov 2009 13:22:18 -0800 Subject: DEV-43046: Move media controls to the bottom of media - Tweaked the algorithm to shift controls down when zoomed in. - Adjusted some numbers in the XUI file - Moved some hard-coded constants into the XUI file so they can be data-driven --- indra/newview/llpanelprimmediacontrols.cpp | 33 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'indra/newview/llpanelprimmediacontrols.cpp') diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 0ca2f0025c..ceb37ae790 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -66,10 +66,6 @@ glh::matrix4f glh_get_current_modelview(); glh::matrix4f glh_get_current_projection(); -const F32 ZOOM_NEAR_PADDING = 1.0f; -const F32 ZOOM_MEDIUM_PADDING = 1.15f; -const F32 ZOOM_FAR_PADDING = 1.5f; - // Warning: make sure these two match! const LLPanelPrimMediaControls::EZoomLevel LLPanelPrimMediaControls::kZoomLevels[] = { ZOOM_NONE, ZOOM_MEDIUM }; const int LLPanelPrimMediaControls::kNumZoomLevels = 2; @@ -152,6 +148,11 @@ BOOL LLPanelPrimMediaControls::postBuild() mRightBookend = getChild("right_bookend"); mBackgroundImage = LLUI::getUIImage(getString("control_background_image_name")); LLStringUtil::convertToF32(getString("skip_step"), mSkipStep); + LLStringUtil::convertToS32(getString("min_width"), mMinWidth); + LLStringUtil::convertToS32(getString("min_height"), mMinHeight); + LLStringUtil::convertToF32(getString("zoom_near_padding"), mZoomNearPadding); + LLStringUtil::convertToF32(getString("zoom_medium_padding"), mZoomMediumPadding); + LLStringUtil::convertToF32(getString("zoom_far_padding"), mZoomFarPadding); // These are currently removed...but getChild creates a "dummy" widget. // This class handles them missing. @@ -257,9 +258,6 @@ LLPluginClassMedia* LLPanelPrimMediaControls::getTargetMediaPlugin() void LLPanelPrimMediaControls::updateShape() { - const S32 MIN_HUD_WIDTH=400; - const S32 MIN_HUD_HEIGHT=120; - LLViewerMediaImpl* media_impl = getTargetMediaImpl(); LLViewerObject* objectp = getTargetObject(); @@ -596,12 +594,12 @@ void LLPanelPrimMediaControls::updateShape() } LLCoordGL screen_min; - screen_min.mX = llround((F32)gViewerWindow->getWorldViewWidthRaw() * (min.mV[VX] + 1.f) * 0.5f); - screen_min.mY = llround((F32)gViewerWindow->getWorldViewHeightRaw() * (min.mV[VY] + 1.f) * 0.5f); + screen_min.mX = llround((F32)gViewerWindow->getWorldViewWidthScaled() * (min.mV[VX] + 1.f) * 0.5f); + screen_min.mY = llround((F32)gViewerWindow->getWorldViewHeightScaled() * (min.mV[VY] + 1.f) * 0.5f); LLCoordGL screen_max; - screen_max.mX = llround((F32)gViewerWindow->getWorldViewWidthRaw() * (max.mV[VX] + 1.f) * 0.5f); - screen_max.mY = llround((F32)gViewerWindow->getWorldViewHeightRaw() * (max.mV[VY] + 1.f) * 0.5f); + screen_max.mX = llround((F32)gViewerWindow->getWorldViewWidthScaled() * (max.mV[VX] + 1.f) * 0.5f); + screen_max.mY = llround((F32)gViewerWindow->getWorldViewHeightScaled() * (max.mV[VY] + 1.f) * 0.5f); // grow panel so that screenspace bounding box fits inside "media_region" element of HUD LLRect media_controls_rect; @@ -610,14 +608,15 @@ void LLPanelPrimMediaControls::updateShape() media_controls_rect.mBottom -= mMediaRegion->getRect().mBottom; media_controls_rect.mTop += getRect().getHeight() - mMediaRegion->getRect().mTop; media_controls_rect.mRight += getRect().getWidth() - mMediaRegion->getRect().mRight; - - LLRect old_hud_rect = media_controls_rect; + // keep all parts of HUD on-screen media_controls_rect.intersectWith(getParent()->getLocalRect()); + if (mCurrentZoom != ZOOM_NONE) + media_controls_rect.mBottom -= mMediaControlsStack->getRect().getHeight() + mMediaProgressPanel->getRect().getHeight(); // clamp to minimum size, keeping centered media_controls_rect.setCenterAndSize(media_controls_rect.getCenterX(), media_controls_rect.getCenterY(), - llmax(MIN_HUD_WIDTH, media_controls_rect.getWidth()), llmax(MIN_HUD_HEIGHT, media_controls_rect.getHeight())); + llmax(mMinWidth, media_controls_rect.getWidth()), llmax(mMinHeight, media_controls_rect.getHeight())); setShape(media_controls_rect, true); @@ -965,17 +964,17 @@ void LLPanelPrimMediaControls::updateZoom() } case ZOOM_FAR: { - zoom_padding = ZOOM_FAR_PADDING; + zoom_padding = mZoomFarPadding; break; } case ZOOM_MEDIUM: { - zoom_padding = ZOOM_MEDIUM_PADDING; + zoom_padding = mZoomMediumPadding; break; } case ZOOM_NEAR: { - zoom_padding = ZOOM_NEAR_PADDING; + zoom_padding = mZoomNearPadding; break; } default: -- cgit v1.2.3 From 3efbd20980175f6dae2cecbfbbd23bb326948189 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 25 Nov 2009 14:39:05 -0800 Subject: Implement fade-out for llprogressbar, fix problem where setTopCtrl was being called Review #47 --- indra/newview/llpanelprimmediacontrols.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview/llpanelprimmediacontrols.cpp') diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index ceb37ae790..c3aa602ee6 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -503,12 +503,10 @@ void LLPanelPrimMediaControls::updateShape() { mMediaProgressPanel->setVisible(true); mMediaProgressBar->setPercent(media_plugin->getProgressPercent()); - gFocusMgr.setTopCtrl(mMediaProgressPanel); } - else if (mMediaProgressPanel->getVisible()) + else { mMediaProgressPanel->setVisible(false); - gFocusMgr.setTopCtrl(NULL); } } -- cgit v1.2.3 From a7fde5f5304651d3afb82e5a202089d78c3c57c7 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 25 Nov 2009 15:50:31 -0800 Subject: DEV-43402: Don't change the zoom level on the media controls if you click away Review #46 This also adds a feature where llpanelprimmediacontrols remembers the object/face that you've zoomed in on, and only switches the zoom/unzoom icon to "unzoom" if the object/face you are hovering over is actually the object/face you are zoomed in on --- indra/newview/llpanelprimmediacontrols.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanelprimmediacontrols.cpp') diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index c3aa602ee6..e86123d565 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -82,7 +82,13 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() : mUpdateSlider(true), mClearFaceOnFade(false), mCurrentRate(0.0), - mMovieDuration(0.0) + mMovieDuration(0.0), + mTargetObjectID(LLUUID::null), + mTargetObjectFace(0), + mTargetImplID(LLUUID::null), + mTargetObjectNormal(LLVector3::zero), + mZoomObjectID(LLUUID::null), + mZoomObjectFace(0) { mCommitCallbackRegistrar.add("MediaCtrl.Close", boost::bind(&LLPanelPrimMediaControls::onClickClose, this)); mCommitCallbackRegistrar.add("MediaCtrl.Back", boost::bind(&LLPanelPrimMediaControls::onClickBack, this)); @@ -277,7 +283,7 @@ void LLPanelPrimMediaControls::updateShape() bool can_navigate = parcel->getMediaAllowNavigate(); bool enabled = false; - bool is_zoomed = (mCurrentZoom != ZOOM_NONE); + bool is_zoomed = (mCurrentZoom != ZOOM_NONE) && (mTargetObjectID == mZoomObjectID) && (mTargetObjectFace == mZoomObjectFace); // There is no such thing as "has_focus" being different from normal controls set // anymore (as of user feedback from bri 10/09). So we cheat here and force 'has_focus' // to 'true' (or, actually, we use a setting) @@ -307,7 +313,7 @@ void LLPanelPrimMediaControls::updateShape() mStopCtrl->setVisible(false); mHomeCtrl->setVisible(has_focus); mZoomCtrl->setVisible(!is_zoomed); - mUnzoomCtrl->setVisible(has_focus && is_zoomed); + mUnzoomCtrl->setVisible(is_zoomed); mOpenCtrl->setVisible(true); mMediaAddressCtrl->setVisible(has_focus && !mini_controls); mMediaPlaySliderPanel->setVisible(has_focus && !mini_controls); @@ -982,9 +988,16 @@ void LLPanelPrimMediaControls::updateZoom() } } - if (zoom_padding > 0.0f) + if (zoom_padding > 0.0f) + { LLViewerMediaFocus::setCameraZoom(getTargetObject(), mTargetObjectNormal, zoom_padding); + } + + // Remember the object ID/face we zoomed into, so we can update the zoom icon appropriately + mZoomObjectID = mTargetObjectID; + mZoomObjectFace = mTargetObjectFace; } + void LLPanelPrimMediaControls::onScrollUp(void* user_data) { LLPanelPrimMediaControls* this_panel = static_cast (user_data); -- cgit v1.2.3