STORM-676 ADDITIONAL_FIX Force color swatch to be 100% opaque while it's in a focused floater.

master
Vadim ProductEngine 2010-12-01 16:01:52 +02:00
parent 3c4cf5a309
commit 77061c1939
3 changed files with 13 additions and 3 deletions

View File

@ -195,7 +195,9 @@ BOOL LLColorSwatchCtrl::handleMouseUp(S32 x, S32 y, MASK mask)
// assumes GL state is set for 2D
void LLColorSwatchCtrl::draw()
{
F32 alpha = getCurrentTransparency();
// 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 );

View File

@ -472,6 +472,12 @@ void LLFloaterColorPicker::onMouseCaptureLost()
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()
@ -533,7 +539,7 @@ void LLFloaterColorPicker::draw()
// base floater stuff
LLFloater::draw ();
const F32 alpha = mCurrentTransparency; // mCurrentTransparency gets updated in 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 % alpha);
@ -636,6 +642,7 @@ const LLColor4& LLFloaterColorPicker::getComplimentaryColor ( const LLColor4& ba
void LLFloaterColorPicker::drawPalette ()
{
S32 curEntry = 0;
const F32 alpha = getSwatchTransparency();
for ( S32 y = 0; y < numPaletteRows; ++y )
{
@ -650,7 +657,7 @@ void LLFloaterColorPicker::drawPalette ()
// draw palette entry color
if ( mPalette [ curEntry ] )
{
gl_rect_2d ( x1 + 2, y1 - 2, x2 - 2, y2 + 2, *mPalette [ curEntry++ ] % mCurrentTransparency, 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 );
}
}

View File

@ -55,6 +55,7 @@ class LLFloaterColorPicker
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 ();