diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llcolorswatch.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llfloatercolorpicker.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llfloatercolorpicker.h | 1 |
3 files changed, 13 insertions, 3 deletions
diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index 2bb54d3fe6..4a1ba6f1b5 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -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 ); diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 998c22f42d..659e52271a 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -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 ); } } diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h index 110fa43b9c..8e387c4f7c 100644 --- a/indra/newview/llfloatercolorpicker.h +++ b/indra/newview/llfloatercolorpicker.h @@ -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 (); |