From 393514f3dc35e005d7359acaa79cb36ea19b7d59 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 25 Nov 2010 23:26:55 +0200 Subject: STORM-677 FIXED Made texture picker control transparent if the floater it resides in is transparent. Also added transparency support to the texture picker floater. --- indra/newview/lltexturectrl.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 328298bda4..759f68b321 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -564,25 +564,26 @@ void LLFloaterTexturePicker::draw() LLRect interior = border; interior.stretch( -1 ); + const F32 alpha = mCurrentTransparency; // mCurrentTransparency gets updated in LLFloater::draw() 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 ); @@ -1263,23 +1264,24 @@ void LLTextureCtrl::draw() LLRect interior = border; interior.stretch( -1 ); + const F32 alpha = 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 ); -- cgit v1.2.3 From 3c4cf5a309612d2a999453b282cad0aab7764083 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 1 Dec 2010 15:46:57 +0200 Subject: STORM-677 ADDITIONAL_FIX Force textures inside texture picker to be 100% opaque while the control is in a focused floater. Besides, made LLFloater handle opacity more like other controls do. --- indra/newview/lltexturectrl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 759f68b321..56e9739350 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -564,7 +564,8 @@ void LLFloaterTexturePicker::draw() LLRect interior = border; interior.stretch( -1 ); - const F32 alpha = mCurrentTransparency; // mCurrentTransparency gets updated in LLFloater::draw() + // 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 ) @@ -1264,7 +1265,8 @@ void LLTextureCtrl::draw() LLRect interior = border; interior.stretch( -1 ); - const F32 alpha = getCurrentTransparency(); + // 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 ) -- cgit v1.2.3