diff options
-rw-r--r-- | indra/newview/llpanelprimmediacontrols.cpp | 33 | ||||
-rw-r--r-- | indra/newview/llpanelprimmediacontrols.h | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_prim_media_controls.xml | 39 |
3 files changed, 43 insertions, 34 deletions
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<LLUICtrl>("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: diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h index accfb72a04..4bb05265c8 100644 --- a/indra/newview/llpanelprimmediacontrols.h +++ b/indra/newview/llpanelprimmediacontrols.h @@ -160,6 +160,11 @@ private: LLUICtrl *mRightBookend; LLUIImage* mBackgroundImage; F32 mSkipStep; + S32 mMinWidth; + S32 mMinHeight; + F32 mZoomNearPadding; + F32 mZoomMediumPadding; + F32 mZoomFarPadding; LLUICtrl *mMediaPanelScroll; LLButton *mScrollUpCtrl; diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml index af4c01185a..8b86067b03 100644 --- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -9,6 +9,11 @@ width="800"> <string name="control_background_image_name">Inspector_Background</string> <string name="skip_step">0.2</string> + <string name="min_width">400</string> + <string name="min_height">120</string> + <string name="zoom_near_padding">1.0</string> + <string name="zoom_medium_padding">1.25</string> + <string name="zoom_far_padding">1.5</string> <panel name="media_region" bottom="125" @@ -20,7 +25,7 @@ name="media_controls" follows="left|right" animate="false" - height="32" + height="26" layout="topleft" left="0" orientation="horizontal" @@ -235,18 +240,17 @@ width="190" min_width="90"> <!-- - RE-ENABLE THIS WHEN WE HAVE A HISTORY DROP-DOWN AGAIN - -<combo_box -name="media_address_url" -allow_text_entry="true" -height="22" -layout="topleft" -max_chars="1024" -tool_tip = "Media URL" -<combo_box.commit_callback -function="MediaCtrl.CommitURL" /> -</combo_box> + RE-ENABLE THIS WHEN WE HAVE A HISTORY DROP-DOWN AGAIN + <combo_box + name="media_address_url" + allow_text_entry="true" + height="22" + layout="topleft" + max_chars="1024" + tool_tip = "Media URL"> + <combo_box.commit_callback + function="MediaCtrl.CommitURL" /> + </combo_box> --> <line_editor name="media_address_url" @@ -304,17 +308,17 @@ function="MediaCtrl.CommitURL" /> user_resize="false" follows="left|right|top|bottom" layout="topleft" + height="16" min_width="100" width="200"> <slider_bar name="media_play_slider" follows="left|right|top" - height="22" + height="16" increment="0.05" initial_value="0.5" layout="topleft" tool_tip="Movie play progress" - top="8" min_width="100" width="200"> <slider_bar.commit_callback @@ -619,7 +623,7 @@ function="MediaCtrl.CommitURL" /> </layout_stack> <layout_stack follows="left|right|bottom" - height="32" + height="20" layout="topleft" animate="false" left="0" @@ -632,7 +636,7 @@ function="MediaCtrl.CommitURL" /> user_resize="false" /> <panel name="media_progress_indicator" - height="22" + height="20" layout="topleft" left="0" top="0" @@ -644,6 +648,7 @@ function="MediaCtrl.CommitURL" /> name="media_progress_bar" color_bar="1 1 1 0.96" follows="left|right|top" + top="5" height="8" layout="topleft" left="0" |