Commits

Scott Lawrence committed 5b940f9 Merge

merge fix for STORM-718

Comments (0)

Files changed (45)

indra/llui/llaccordionctrltab.cpp

 	S32 width = getRect().getWidth();
 	S32 height = getRect().getHeight();
 
-	gl_rect_2d(0,0,width - 1 ,height - 1,mHeaderBGColor.get(),true);
+	F32 alpha = getCurrentTransparency();
+	gl_rect_2d(0,0,width - 1 ,height - 1,mHeaderBGColor.get() % alpha,true);
 
 	LLAccordionCtrlTab* parent = dynamic_cast<LLAccordionCtrlTab*>(getParent());
 	bool collapsible = (parent && parent->getCollapsible());

indra/llui/llbutton.cpp

 	is_toggle("is_toggle", false),
 	scale_image("scale_image", true),
 	hover_glow_amount("hover_glow_amount"),
-	commit_on_return("commit_on_return", true)
+	commit_on_return("commit_on_return", true),
+	use_draw_context_alpha("use_draw_context_alpha", true)
 {
 	addSynonym(is_toggle, "toggle");
 	held_down_delay.seconds = 0.5f;
 	mLastDrawCharsCount(0),
 	mMouseDownSignal(NULL),
 	mMouseUpSignal(NULL),
-	mHeldDownSignal(NULL)
+	mHeldDownSignal(NULL),
+	mUseDrawContextAlpha(p.use_draw_context_alpha)
 
 {
 	static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0);
 // virtual
 void LLButton::draw()
 {
-	F32 alpha = getDrawContext().mAlpha;
+	F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency();
 	bool flash = FALSE;
 	static LLUICachedControl<F32> button_flash_rate("ButtonFlashRate", 0);
 	static LLUICachedControl<S32> button_flash_count("ButtonFlashCount", 0);

indra/llui/llbutton.h

 		Optional<F32>				hover_glow_amount;
 		Optional<TimeIntervalParam>	held_down_delay;
 
+		Optional<bool>			use_draw_context_alpha;
+
 		Params();
 	};
 	
 	S32							mImageOverlayTopPad;
 	S32							mImageOverlayBottomPad;
 
+	bool						mUseDrawContextAlpha;
+
 	/*
 	 * Space between image_overlay and label
 	 */

indra/llui/llfloater.cpp

 // use this to control "jumping" behavior when Ctrl-Tabbing
 const S32 TABBED_FLOATER_OFFSET = 0;
 
-// static
-F32 LLFloater::sActiveFloaterTransparency = 0.0f;
-F32 LLFloater::sInactiveFloaterTransparency = 0.0f;
-
 std::string	LLFloater::sButtonNames[BUTTON_COUNT] = 
 {
 	"llfloater_close_btn",		//BUTTON_CLOSE
 	if (ctrl)
 	{
 		ctrl->getSignal()->connect(boost::bind(&LLFloater::updateActiveFloaterTransparency));
-		sActiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency");
+		updateActiveFloaterTransparency();
 	}
 
 	ctrl = LLUI::sSettingGroups["config"]->getControl("InactiveFloaterTransparency").get();
 	if (ctrl)
 	{
 		ctrl->getSignal()->connect(boost::bind(&LLFloater::updateInactiveFloaterTransparency));
-		sInactiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency");
+		updateInactiveFloaterTransparency();
 	}
 
 }
 
 LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
 :	LLPanel(),	// intentionally do not pass params here, see initFromParams
-	mDragHandle(NULL),
+ 	mDragHandle(NULL),
 	mTitle(p.title),
 	mShortTitle(p.short_title),
 	mSingleInstance(p.single_instance),
 // static
 void LLFloater::updateActiveFloaterTransparency()
 {
-	sActiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency");
+	sActiveControlTransparency = LLUI::sSettingGroups["config"]->getF32("ActiveFloaterTransparency");
 }
 
 // static
 void LLFloater::updateInactiveFloaterTransparency()
 {
-	sInactiveFloaterTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency");
+	sInactiveControlTransparency = LLUI::sSettingGroups["config"]->getF32("InactiveFloaterTransparency");
 }
 
 void LLFloater::addResizeCtrls()
 			last_focus->setFocus(TRUE);
 		}
 	}
+	updateTransparency(this, b ? TT_ACTIVE : TT_INACTIVE);
 }
 
 // virtual
 // virtual
 void LLFloater::draw()
 {
-	mCurrentTransparency = hasFocus() ? sActiveFloaterTransparency : sInactiveFloaterTransparency;
+	const F32 alpha = getCurrentTransparency();
 
 	// draw background
 	if( isBackgroundVisible() )
 		if (image)
 		{
 			// We're using images for this floater's backgrounds
-			image->draw(getLocalRect(), overlay_color % mCurrentTransparency);
+			image->draw(getLocalRect(), overlay_color % alpha);
 		}
 		else
 		{
 			// We're not using images, use old-school flat colors
-			gl_rect_2d( left, top, right, bottom, color % mCurrentTransparency );
+			gl_rect_2d( left, top, right, bottom, color % alpha );
 
 			// draw highlight on title bar to indicate focus.  RDW
 			if(hasFocus() 
 				const LLFontGL* font = LLFontGL::getFontSansSerif();
 				LLRect r = getRect();
 				gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1, 
-					titlebar_focus_color % mCurrentTransparency, 0, TRUE);
+					titlebar_focus_color % alpha, 0, TRUE);
 			}
 		}
 	}
 		shadow_color.mV[VALPHA] *= 0.5f;
 	}
 	gl_drop_shadow(left, top, right, bottom, 
-		shadow_color % mCurrentTransparency,
+		shadow_color % getCurrentTransparency(),
 		llround(shadow_offset));
 }
 
+void LLFloater::updateTransparency(LLView* view, ETypeTransparency transparency_type)
+{
+	child_list_t children = *view->getChildList();
+	child_list_t::iterator it = children.begin();
+
+	LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(view);
+	if (ctrl)
+	{
+		ctrl->setTransparencyType(transparency_type);
+	}
+
+	for(; it != children.end(); ++it)
+	{
+		updateTransparency(*it, transparency_type);
+	}
+}
+
+void LLFloater::updateTransparency(ETypeTransparency transparency_type)
+{
+	updateTransparency(this, transparency_type);
+}
+
 void	LLFloater::setCanMinimize(BOOL can_minimize)
 {
 	// if removing minimize/restore button programmatically,

indra/llui/llfloater.h

 
 	static void		setFloaterHost(LLMultiFloater* hostp) {sHostp = hostp; }
 	static LLMultiFloater* getFloaterHost() {return sHostp; }
+
+	void			updateTransparency(ETypeTransparency transparency_type);
 		
 protected:
 
 
 	static void		updateActiveFloaterTransparency();
 	static void		updateInactiveFloaterTransparency();
+	void			updateTransparency(LLView* view, ETypeTransparency transparency_type);
 
 public:
 	// Called when floater is opened, passes mKey
 	bool            mDocked;
 	bool            mTornOff;
 
-	F32				mCurrentTransparency;
-
-	static F32		sActiveFloaterTransparency;
-	static F32		sInactiveFloaterTransparency;
-
 	static LLMultiFloater* sHostp;
 	static BOOL		sQuitting;
 	static std::string	sButtonNames[BUTTON_COUNT];

indra/llui/lliconctrl.cpp

 LLIconCtrl::Params::Params()
 :	image("image_name"),
 	color("color"),
+	use_draw_context_alpha("use_draw_context_alpha", true),
 	scale_image("scale_image")
 {
 	tab_stop = false;
 :	LLUICtrl(p),
 	mColor(p.color()),
 	mImagep(p.image),
+	mUseDrawContextAlpha(p.use_draw_context_alpha),
 	mPriority(0),
 	mDrawWidth(0),
 	mDrawHeight(0)
 {
 	if( mImagep.notNull() )
 	{
-		mImagep->draw(getLocalRect(), mColor.get() % getDrawContext().mAlpha );
+		const F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency();
+		mImagep->draw(getLocalRect(), mColor.get() % alpha );
 	}
 
 	LLUICtrl::draw();

indra/llui/lliconctrl.h

 	{
 		Optional<LLUIImage*>	image;
 		Optional<LLUIColor>		color;
+		Optional<bool>			use_draw_context_alpha;
 		Ignored					scale_image;
 		Params();
 	};
 	S32 mDrawWidth ;
 	S32 mDrawHeight ;
 
+	// If set to true (default), use the draw context transparency.
+	// If false, will use transparency returned by getCurrentTransparency(). See STORM-698.
+	bool mUseDrawContextAlpha;
+
 private:
 	LLUIColor mColor;
 	LLPointer<LLUIImage> mImagep;

indra/llui/lllineeditor.cpp

 		image = mBgImage;
 	}
 	
-	F32 alpha = getDrawContext().mAlpha;
+	F32 alpha = getCurrentTransparency();
+
 	// optionally draw programmatic border
 	if (has_focus)
 	{

indra/llui/llpanel.cpp

 	// draw background
 	if( mBgVisible )
 	{
+		alpha = getCurrentTransparency();
+
 		LLRect local_rect = getLocalRect();
 		if (mBgOpaque )
 		{

indra/llui/llscrollcontainer.cpp

 	// Draw background
 	if( mIsOpaque )
 	{
+		F32 alpha = getCurrentTransparency();
+
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-		gGL.color4fv( mBackgroundColor.get().mV );
-		gl_rect_2d( mInnerRect );
+		gl_rect_2d(mInnerRect, mBackgroundColor.get() % alpha);
 	}
 	
 	// Draw mScrolledViews and update scroll bars.

indra/llui/llscrolllistctrl.cpp

 	// Draw background
 	if (mBackgroundVisible)
 	{
+		F32 alpha = getCurrentTransparency();
 		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-		gl_rect_2d(background, getEnabled() ? mBgWriteableColor.get() : mBgReadOnlyColor.get() );
+		gl_rect_2d(background, getEnabled() ? mBgWriteableColor.get() % alpha : mBgReadOnlyColor.get() % alpha );
 	}
 
 	if (mColumnsDirty)

indra/llui/lltextbase.cpp

 
 	if (mBGVisible)
 	{
+		F32 alpha = getCurrentTransparency();
 		// clip background rect against extents, if we support scrolling
 		LLRect bg_rect = mVisibleTextRect;
 		if (mScroller)
 							: hasFocus() 
 								? mFocusBgColor.get() 
 								: mWriteableBgColor.get();
-		gl_rect_2d(doc_rect, bg_color, TRUE);
+		gl_rect_2d(doc_rect, bg_color % alpha, TRUE);
 	}
 
 	// draw document view

indra/llui/llui.cpp

 }
 
 // Draw gray and white checkerboard with black border
-void gl_rect_2d_checkerboard(const LLRect& rect)
+void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha)
 {
 	// Initialize the first time this is called.
 	const S32 PIXELS = 32;
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
 	// ...white squares
-	gGL.color3f( 1.f, 1.f, 1.f );
+	gGL.color4f( 1.f, 1.f, 1.f, alpha );
 	gl_rect_2d(rect);
 
 	// ...gray squares
-	gGL.color3f( .7f, .7f, .7f );
+	gGL.color4f( .7f, .7f, .7f, alpha );
 	gGL.flush();
 	glPolygonStipple( checkerboard );
 

indra/llui/llui.h

 void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixel_offset = 0, BOOL filled = TRUE );
 void gl_rect_2d(const LLRect& rect, BOOL filled = TRUE );
 void gl_rect_2d(const LLRect& rect, const LLColor4& color, BOOL filled = TRUE );
-void gl_rect_2d_checkerboard(const LLRect& rect);
+void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha = 1.0f);
 
 void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &start_color, S32 lines);
 

indra/llui/lluictrl.cpp

 
 static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl");
 
+F32 LLUICtrl::sActiveControlTransparency = 1.0f;
+F32 LLUICtrl::sInactiveControlTransparency = 1.0f;
+
 // Compiler optimization, generate extern template
 template class LLUICtrl* LLView::getChild<class LLUICtrl>(
 	const std::string& name, BOOL recurse) const;
 	mMouseUpSignal(NULL),
 	mRightMouseDownSignal(NULL),
 	mRightMouseUpSignal(NULL),
-	mDoubleClickSignal(NULL)
+	mDoubleClickSignal(NULL),
+	mTransparencyType(TT_DEFAULT)
 {
 	mUICtrlHandle.bind(this);
 }
 void LLUICtrl::setColor(const LLColor4& color)							
 { }
 
+F32 LLUICtrl::getCurrentTransparency()
+{
+	F32 alpha = 0;
+
+	switch(mTransparencyType)
+	{
+	case TT_DEFAULT:
+		alpha = getDrawContext().mAlpha;
+		break;
+
+	case TT_ACTIVE:
+		alpha = sActiveControlTransparency;
+		break;
+
+	case TT_INACTIVE:
+		alpha = sInactiveControlTransparency;
+		break;
+	}
+
+	return alpha;
+}
+
+void LLUICtrl::setTransparencyType(ETypeTransparency type)
+{
+	mTransparencyType = type;
+}
+
 boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t::slot_type& cb ) 
 { 
 	if (!mCommitSignal) mCommitSignal = new commit_signal_t();

indra/llui/lluictrl.h

 		Params();
 	};
 
+	enum ETypeTransparency
+	{
+		TT_DEFAULT,
+		TT_ACTIVE,
+		TT_INACTIVE
+	};
 	/*virtual*/ ~LLUICtrl();
 
 	void initFromParams(const Params& p);
 
 	virtual void	setColor(const LLColor4& color);
 
+	F32 			getCurrentTransparency();
+
+	void				setTransparencyType(ETypeTransparency type);
+	ETypeTransparency	getTransparencyType() const {return mTransparencyType;}
+
 	BOOL	focusNextItem(BOOL text_entry_only);
 	BOOL	focusPrevItem(BOOL text_entry_only);
 	BOOL 	focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
 	boost::signals2::connection mMakeVisibleControlConnection;
 	LLControlVariable* mMakeInvisibleControlVariable;
 	boost::signals2::connection mMakeInvisibleControlConnection;
+
+	static F32 sActiveControlTransparency;
+	static F32 sInactiveControlTransparency;
+
 private:
 
 	BOOL			mTabStop;
 	BOOL			mTentative;
 	LLRootHandle<LLUICtrl> mUICtrlHandle;
 
+	ETypeTransparency mTransparencyType;
+
 	class DefaultTabGroupFirstSorter;
 };
 

indra/newview/llcolorswatch.cpp

 // assumes GL state is set for 2D
 void LLColorSwatchCtrl::draw()
 {
-	F32 alpha = getDrawContext().mAlpha;
+	// If we're in a focused floater, don't apply the floater's alpha to the color swatch (STORM-676).
+	F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
+
 	mBorder->setKeyboardFocusHighlight(hasFocus());
 	// Draw border
 	LLRect border( 0, getRect().getHeight(), getRect().getWidth(), mLabelHeight );
 	// Check state
 	if ( mValid )
 	{
+		if (!mColor.isOpaque())
+		{
+			// Draw checker board.
+			gl_rect_2d_checkerboard(interior, alpha);
+		}
+
 		// Draw the color swatch
-		gl_rect_2d_checkerboard( interior );
-		gl_rect_2d(interior, mColor, TRUE);
-		LLColor4 opaque_color = mColor;
-		opaque_color.mV[VALPHA] = 1.f;
-		gGL.color4fv(opaque_color.mV);
-		if (mAlphaGradientImage.notNull())
+		gl_rect_2d(interior, mColor % alpha, TRUE);
+
+		if (!mColor.isOpaque())
 		{
-			gGL.pushMatrix();
+			// Draw semi-transparent center area in filled with mColor.
+			LLColor4 opaque_color = mColor;
+			opaque_color.mV[VALPHA] = alpha;
+			gGL.color4fv(opaque_color.mV);
+			if (mAlphaGradientImage.notNull())
 			{
-				mAlphaGradientImage->draw(interior, mColor);
+				gGL.pushMatrix();
+				{
+					mAlphaGradientImage->draw(interior, mColor % alpha);
+				}
+				gGL.popMatrix();
 			}
-			gGL.popMatrix();
 		}
 	}
 	else

indra/newview/llfloatercolorpicker.cpp

 	setMouseDownInLumRegion(FALSE);
 }
 
+F32 LLFloaterColorPicker::getSwatchTransparency()
+{
+	// If the floater is focused, don't apply its alpha to the color swatch (STORM-676).
+	return getTransparencyType() == TT_ACTIVE ? 1.f : LLFloater::getCurrentTransparency();
+}
+
 //////////////////////////////////////////////////////////////////////////////
 //
 void LLFloaterColorPicker::draw()
 	// base floater stuff
 	LLFloater::draw ();
 
+	const F32 alpha = getSwatchTransparency();
+
 	// draw image for RGB area (not really RGB but you'll see what I mean...
-	gl_draw_image ( mRGBViewerImageLeft, mRGBViewerImageTop - mRGBViewerImageHeight, mRGBImage, LLColor4::white );
+	gl_draw_image ( mRGBViewerImageLeft, mRGBViewerImageTop - mRGBViewerImageHeight, mRGBImage, LLColor4::white % alpha);
 
 	// update 'cursor' into RGB Section
 	S32 xPos = ( S32 ) ( ( F32 )mRGBViewerImageWidth * getCurH () ) - 8;
 				 mRGBViewerImageTop - mRGBViewerImageHeight,
 				 mRGBViewerImageLeft + mRGBViewerImageWidth + 1,
 				 mRGBViewerImageTop,
-				 LLColor4 ( 0.0f, 0.0f, 0.0f, 1.0f ),
+				 LLColor4 ( 0.0f, 0.0f, 0.0f, alpha ),
 				 FALSE );
 
 	// draw luminance slider
 			mLumRegionTop - mLumRegionHeight + y, 
 				mLumRegionLeft + mLumRegionWidth, 
 					mLumRegionTop - mLumRegionHeight + y - 1, 
-						LLColor4 ( rValSlider, gValSlider, bValSlider, 1.0f ) );
+						LLColor4 ( rValSlider, gValSlider, bValSlider, alpha ) );
 	}
 
 
 				 mSwatchRegionTop - mSwatchRegionHeight,
 				 mSwatchRegionLeft + mSwatchRegionWidth,
 				 mSwatchRegionTop,
-				 LLColor4 ( getCurR (), getCurG (), getCurB (), 1.0f ),
+				 LLColor4 ( getCurR (), getCurG (), getCurB (), alpha ),
 				 TRUE );
 
 	// draw selected color swatch outline
 void LLFloaterColorPicker::drawPalette ()
 {
 	S32 curEntry = 0;
+	const F32 alpha = getSwatchTransparency();
 
 	for ( S32 y = 0; y < numPaletteRows; ++y )
 	{
 			// draw palette entry color
 			if ( mPalette [ curEntry ] )
 			{
-				gl_rect_2d ( x1 + 2, y1 - 2, x2 - 2, y2 + 2, *mPalette [ curEntry++ ], TRUE );
+				gl_rect_2d ( x1 + 2, y1 - 2, x2 - 2, y2 + 2, *mPalette [ curEntry++ ] % alpha, TRUE );
 				gl_rect_2d ( x1 + 1, y1 - 1, x2 - 1, y2 + 1, LLColor4 ( 0.0f, 0.0f, 0.0f, 1.0f ), FALSE );
 			}
 		}

indra/newview/llfloatercolorpicker.h

 		virtual BOOL handleMouseUp ( S32 x, S32 y, MASK mask );
 		virtual BOOL handleHover ( S32 x, S32 y, MASK mask );
 		virtual void onMouseCaptureLost();
+		virtual F32  getSwatchTransparency();
 
 		// implicit methods
 		void createUI ();

indra/newview/llfloaterevent.cpp

 		
 	}
 }
-
-void LLFloaterEvent::draw()
-{
-	LLPanel::draw();
-}

indra/newview/llfloaterevent.h

 	/*virtual*/ ~LLFloaterEvent();
 
 	/*virtual*/ BOOL postBuild();
-	/*virtual*/ void draw();
 
 	void setEventID(const U32 event_id);
 

indra/newview/llfloaterpostcard.cpp

 
 	if(!isMinimized() && mViewerImage.notNull() && mJPEGImage.notNull()) 
 	{
+		// Force the texture to be 100% opaque when the floater is focused.
+		F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
 		LLRect rect(getRect());
 
 		// first set the max extents of our preview
 		}
 		{
 			gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-			gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f));
+			gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f) % alpha);
 			rect.stretch(-1);
 		}
 		{
 								 rect.getWidth(),
 								 rect.getHeight(),
 								 mViewerImage.get(), 
-								 LLColor4::white);
+								 LLColor4::white % alpha);
 		}
 		glMatrixMode(GL_TEXTURE);
 		glPopMatrix();

indra/newview/llfloatersnapshot.cpp

 			S32 offset_y = thumbnail_rect.mBottom + (thumbnail_rect.getHeight() - previewp->getThumbnailHeight()) / 2 ;
 
 			glMatrixMode(GL_MODELVIEW);
+			// Apply floater transparency to the texture unless the floater is focused.
+			F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
 			gl_draw_scaled_image(offset_x, offset_y, 
 					previewp->getThumbnailWidth(), previewp->getThumbnailHeight(), 
-					previewp->getThumbnailImage(), LLColor4::white);	
+					previewp->getThumbnailImage(), LLColor4::white % alpha);
 
 			previewp->drawPreviewRect(offset_x, offset_y) ;
 		}

indra/newview/llinventorylistitem.cpp

 		LLRect separator_rect = getLocalRect();
 		separator_rect.mTop = separator_rect.mBottom;
 		separator_rect.mBottom -= mSeparatorImage->getHeight();
-		mSeparatorImage->draw(separator_rect);
+		F32 alpha = getCurrentTransparency();
+		mSeparatorImage->draw(separator_rect, UI_VERTEX_COLOR % alpha);
 	}
 	
 	LLPanel::draw();

indra/newview/llnearbychat.cpp

 		mChatHistory->setFocus(TRUE);
 	return LLDockableFloater::handleMouseDown(x, y, mask);
 }
+
+void LLNearbyChat::draw()
+{
+	// *HACK: Update transparency type depending on whether our children have focus.
+	// This is needed because this floater is chrome and thus cannot accept focus, so
+	// the transparency type setting code from LLFloater::setFocus() isn't reached.
+	if (getTransparencyType() != TT_DEFAULT)
+	{
+		setTransparencyType(hasFocus() ? TT_ACTIVE : TT_INACTIVE);
+	}
+
+	LLDockableFloater::draw();
+}

indra/newview/llnearbychat.h

 	bool	onNearbyChatCheckContextMenuItem(const LLSD& userdata);
 
 	virtual BOOL	handleMouseDown(S32 x, S32 y, MASK mask);
+	virtual void	draw();
 
 	// focus overrides
 	/*virtual*/ void	onFocusLost();

indra/newview/llsidetray.cpp

 protected:
 	LLSideTrayTab(const Params& params);
 	
-	void			dock();
+	void			dock(LLFloater* floater_tab);
 	void			undock(LLFloater* floater_tab);
 
 	LLSideTray*		getSideTray();
 
 	if (docking)
 	{
-		dock();
+		dock(floater_tab);
 	}
 	else
 	{
 	LLFloaterReg::toggleInstance("side_bar_tab", tab_name);
 }
 
-void LLSideTrayTab::dock()
+void LLSideTrayTab::dock(LLFloater* floater_tab)
 {
 	LLSideTray* side_tray = getSideTray();
 	if (!side_tray) return;
 
+	// Before docking the tab, reset its (and its children's) transparency to default (STORM-688).
+	floater_tab->updateTransparency(TT_DEFAULT);
+
 	if (!side_tray->addTab(this))
 	{
 		llwarns << "Failed to add tab " << getName() << " to side tray" << llendl;

indra/newview/lltexturectrl.cpp

 		LLRect interior = border;
 		interior.stretch( -1 ); 
 
+		// If the floater is focused, don't apply its alpha to the texture (STORM-677).
+		const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
 		if( mTexturep )
 		{
 			if( mTexturep->getComponents() == 4 )
 			{
-				gl_rect_2d_checkerboard( interior );
+				gl_rect_2d_checkerboard( interior, alpha );
 			}
 
-			gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep );
+			gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha );
 
 			// Pump the priority
 			mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
 		}
 		else if (!mFallbackImage.isNull())
 		{
-			mFallbackImage->draw(interior);
+			mFallbackImage->draw(interior, UI_VERTEX_COLOR % alpha);
 		}
 		else
 		{
-			gl_rect_2d( interior, LLColor4::grey, TRUE );
+			gl_rect_2d( interior, LLColor4::grey % alpha, TRUE );
 
 			// Draw X
 			gl_draw_x(interior, LLColor4::black );
 	LLRect interior = border;
 	interior.stretch( -1 ); 
 
+	// If we're in a focused floater, don't apply the floater's alpha to the texture (STORM-677).
+	const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
 	if( mTexturep )
 	{
 		if( mTexturep->getComponents() == 4 )
 		{
-			gl_rect_2d_checkerboard( interior );
+			gl_rect_2d_checkerboard( interior, alpha );
 		}
 		
-		gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep);
+		gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha);
 		mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
 	}
 	else if (!mFallbackImage.isNull())
 	{
-		mFallbackImage->draw(interior);
+		mFallbackImage->draw(interior, UI_VERTEX_COLOR % alpha);
 	}
 	else
 	{
-		gl_rect_2d( interior, LLColor4::grey, TRUE );
+		gl_rect_2d( interior, LLColor4::grey % alpha, TRUE );
 
 		// Draw X
 		gl_draw_x( interior, LLColor4::black );

indra/newview/skins/default/xui/en/floater_buy_currency.xml

      left="0"
      name="normal_background"
      top="17"
+     use_draw_context_alpha="false"
      width="350" />
    <text
      type="string"
      left="0"
      name="error_background"
      top="15"
+     use_draw_context_alpha="false"
      width="350"/>
     <text
      type="string"

indra/newview/skins/default/xui/en/floater_nearby_chat.xml

 <floater
  border_visible="false"
  border="false"
- bg_opaque_image="Window_Foreground" 
- bg_alpha_image="Window_Background" 
- bg_alpha_image_overlay="DkGray_66" 
  legacy_header_height="18"
  can_minimize="true"
  can_tear_off="false"

indra/newview/skins/default/xui/en/panel_classified_info.xml

      left="10"
      tab_stop="false"
      top="2"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
     <text
      follows="top|left|right"
      font="SansSerifHugeBold"

indra/newview/skins/default/xui/en/panel_edit_classified.xml

      left="10"
      tab_stop="false"
      top="2"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
    <text
      type="string"
      length="1"

indra/newview/skins/default/xui/en/panel_edit_pick.xml

      left="10"
      tab_stop="false"
      top="2"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
    <text
      type="string"
      length="1"

indra/newview/skins/default/xui/en/panel_edit_wearable.xml

      pad_left="24"
      tool_tip="Return to Edit Outfit"
      top="3"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
     <text
      follows="top|left|right"
      font="SansSerifHugeBold"

indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml

      left="7"
      tab_stop="false"
      top="2"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
     <text_editor
      allow_scroll="false"
      bg_visible="false"

indra/newview/skins/default/xui/en/panel_landmark_info.xml

      tool_tip="Back"
      tab_stop="false"
      top="4"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
     <text
      follows="top|left|right"
      font="SansSerifHugeBold"

indra/newview/skins/default/xui/en/panel_outfit_edit.xml

      left="5"
      tab_stop="false"
      top="1"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
     <text
      follows="top|left|right"
      font="SansSerifHugeBold"

indra/newview/skins/default/xui/en/panel_pick_info.xml

      left="10"
      tab_stop="false"
      top="2"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
     <text
      follows="top|left|right"
      font="SansSerifHugeBold"

indra/newview/skins/default/xui/en/panel_place_profile.xml

      tool_tip="Back"
      tab_stop="false"
      top="4"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
     <text
      follows="top|left|right"
      font="SansSerifHugeBold"

indra/newview/skins/default/xui/en/panel_profile_view.xml

    left="10"
    tab_stop="false"
    top="2"
-   width="30" />
+   width="30"
+   use_draw_context_alpha="false" />
   <text
    top="10"
    follows="top|left"

indra/newview/skins/default/xui/en/sidepanel_item_info.xml

      name="back_btn"
      tab_stop="false"
      top="2"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
     <text
      follows="top|left|right"
      font="SansSerifHugeBold"

indra/newview/skins/default/xui/en/sidepanel_task_info.xml

      name="back_btn"
      tab_stop="false"
      top="0"
-     width="30" />
+     width="30"
+     use_draw_context_alpha="false" />
         <text
      follows="top|left|right"
      font="SansSerifHuge"

indra/newview/skins/default/xui/en/widgets/avatar_icon.xml

 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 
-<avatar_icon default_icon_name="Generic_Person_Large">
+<avatar_icon
+    default_icon_name="Generic_Person_Large"
+    use_draw_context_alpha="false">
 </avatar_icon>

indra/newview/skins/default/xui/en/widgets/button.xml

         halign="center"
         pad_bottom="3" 
         height="23"
-        scale_image="true">
+        scale_image="true"
+        use_draw_context_alpha="true">
 </button>

indra/newview/skins/default/xui/en/widgets/icon.xml

       tab_stop="false"
       mouse_opaque="false"
       name="icon"
+      use_draw_context_alpha="true"
       follows="left|top">
 </icon>