From 3efbd20980175f6dae2cecbfbbd23bb326948189 Mon Sep 17 00:00:00 2001
From: Rick Pasetto <rick@lindenlab.com>
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/llui/llprogressbar.cpp               | 9 +++++----
 indra/newview/llpanelprimmediacontrols.cpp | 4 +---
 2 files changed, 6 insertions(+), 7 deletions(-)

(limited to 'indra')

diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp
index c8b6e814e1..62ca569e6c 100644
--- a/indra/llui/llprogressbar.cpp
+++ b/indra/llui/llprogressbar.cpp
@@ -72,12 +72,13 @@ LLProgressBar::~LLProgressBar()
 void LLProgressBar::draw()
 {
 	static LLTimer timer;
-
-	LLUIImagePtr bar_fg_imagep = LLUI::getUIImage("progressbar_fill.tga");
+	F32 alpha = getDrawContext().mAlpha;
 	
-	mImageBar->draw(getLocalRect(), mColorBackground.get());
+	LLColor4 image_bar_color = mColorBackground.get();
+	image_bar_color.setAlpha(alpha);
+	mImageBar->draw(getLocalRect(), image_bar_color);
 
-	F32 alpha = 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32()));
+	alpha *= 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32()));
 	LLColor4 bar_color = mColorBar.get();
 	bar_color.mV[VALPHA] *= alpha; // modulate alpha
 	LLRect progress_rect = getLocalRect();
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