summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatercolorpicker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatercolorpicker.cpp')
-rw-r--r--indra/newview/llfloatercolorpicker.cpp149
1 files changed, 74 insertions, 75 deletions
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index 324da688f8..137b35c3ee 100644
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -577,7 +577,7 @@ void LLFloaterColorPicker::draw()
glEnd();
}
- if (gFocusMgr.childHasMouseCapture(mDragHandle))
+ if (gFocusMgr.childHasMouseCapture(getDragHandle()))
{
mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME));
}
@@ -902,104 +902,103 @@ BOOL
LLFloaterColorPicker::
handleMouseDown ( S32 x, S32 y, MASK mask )
{
- // if this window is in the foreground
- if ( mForeground )
- {
+ BOOL ret = LLFloater::handleMouseDown ( x, y, mask );
+
// make it the frontmost
- gFloaterView->bringToFront(this);
+ gFloaterView->bringToFront(this);
- // rect containing RGB area
- LLRect rgbAreaRect ( mRGBViewerImageLeft,
- mRGBViewerImageTop,
- mRGBViewerImageLeft + mRGBViewerImageWidth,
- mRGBViewerImageTop - mRGBViewerImageHeight );
+ // rect containing RGB area
+ LLRect rgbAreaRect ( mRGBViewerImageLeft,
+ mRGBViewerImageTop,
+ mRGBViewerImageLeft + mRGBViewerImageWidth,
+ mRGBViewerImageTop - mRGBViewerImageHeight );
- if ( rgbAreaRect.pointInRect ( x, y ) )
- {
- gViewerWindow->setMouseCapture(this);
- // mouse button down
- setMouseDownInHueRegion ( TRUE );
+ if ( rgbAreaRect.pointInRect ( x, y ) )
+ {
+ gViewerWindow->setMouseCapture(this);
+ // mouse button down
+ setMouseDownInHueRegion ( TRUE );
- // update all values based on initial click
- updateRgbHslFromPoint ( x, y );
+ // update all values based on initial click
+ updateRgbHslFromPoint ( x, y );
- // required by base class
- return TRUE;
- }
+ // required by base class
+ return TRUE;
+ }
- // rect containing RGB area
- LLRect lumAreaRect ( mLumRegionLeft,
- mLumRegionTop,
- mLumRegionLeft + mLumRegionWidth + mLumMarkerSize,
- mLumRegionTop - mLumRegionHeight );
+ // rect containing RGB area
+ LLRect lumAreaRect ( mLumRegionLeft,
+ mLumRegionTop,
+ mLumRegionLeft + mLumRegionWidth + mLumMarkerSize,
+ mLumRegionTop - mLumRegionHeight );
- if ( lumAreaRect.pointInRect ( x, y ) )
- {
- gViewerWindow->setMouseCapture(this);
- // mouse button down
- setMouseDownInLumRegion ( TRUE );
+ if ( lumAreaRect.pointInRect ( x, y ) )
+ {
+ gViewerWindow->setMouseCapture(this);
+ // mouse button down
+ setMouseDownInLumRegion ( TRUE );
- // required by base class
- return TRUE;
- }
+ // required by base class
+ return TRUE;
+ }
- // rect containing swatch area
- LLRect swatchRect ( mSwatchRegionLeft,
- mSwatchRegionTop,
- mSwatchRegionLeft + mSwatchRegionWidth,
- mSwatchRegionTop - mSwatchRegionHeight );
+ // rect containing swatch area
+ LLRect swatchRect ( mSwatchRegionLeft,
+ mSwatchRegionTop,
+ mSwatchRegionLeft + mSwatchRegionWidth,
+ mSwatchRegionTop - mSwatchRegionHeight );
- setMouseDownInSwatch( FALSE );
- if ( swatchRect.pointInRect ( x, y ) )
- {
- setMouseDownInSwatch( TRUE );
+ setMouseDownInSwatch( FALSE );
+ if ( swatchRect.pointInRect ( x, y ) )
+ {
+ setMouseDownInSwatch( TRUE );
- // required - dont drag windows here.
- return TRUE;
- }
+ // required - dont drag windows here.
+ return TRUE;
+ }
- // rect containing palette area
- LLRect paletteRect ( mPaletteRegionLeft,
- mPaletteRegionTop,
- mPaletteRegionLeft + mPaletteRegionWidth,
- mPaletteRegionTop - mPaletteRegionHeight );
+ // rect containing palette area
+ LLRect paletteRect ( mPaletteRegionLeft,
+ mPaletteRegionTop,
+ mPaletteRegionLeft + mPaletteRegionWidth,
+ mPaletteRegionTop - mPaletteRegionHeight );
- if ( paletteRect.pointInRect ( x, y ) )
+ if ( paletteRect.pointInRect ( x, y ) )
+ {
+ // release keyboard focus so we can change text values
+ if (gFocusMgr.childHasKeyboardFocus(this))
{
- // release keyboard focus so we can change text values
- if (gFocusMgr.childHasKeyboardFocus(this))
- {
- mSelectBtn->setFocus(TRUE);
- }
-
- // calculate which palette index we selected
- S32 c = ( ( x - mPaletteRegionLeft ) * numPaletteColumns ) / mPaletteRegionWidth;
- S32 r = ( ( y - ( mPaletteRegionTop - mPaletteRegionHeight ) ) * numPaletteRows ) / mPaletteRegionHeight;
+ mSelectBtn->setFocus(TRUE);
+ }
- U32 index = ( numPaletteRows - r - 1 ) * numPaletteColumns + c;
+ // calculate which palette index we selected
+ S32 c = ( ( x - mPaletteRegionLeft ) * numPaletteColumns ) / mPaletteRegionWidth;
+ S32 r = ( ( y - ( mPaletteRegionTop - mPaletteRegionHeight ) ) * numPaletteRows ) / mPaletteRegionHeight;
- if ( index <= mPalette.size () )
- {
- LLColor4 selected = *mPalette [ index ];
+ U32 index = ( numPaletteRows - r - 1 ) * numPaletteColumns + c;
- setCurRgb ( selected [ 0 ], selected [ 1 ], selected [ 2 ] );
+ if ( index <= mPalette.size () )
+ {
+ LLColor4 selected = *mPalette [ index ];
- if (mApplyImmediateCheck->get())
- {
- LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
- }
+ setCurRgb ( selected [ 0 ], selected [ 1 ], selected [ 2 ] );
- // HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
- enableTextCallbacks ( FALSE );
- updateTextEntry ();
- enableTextCallbacks ( TRUE );
+ if (mApplyImmediateCheck->get())
+ {
+ LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
}
- return TRUE;
+ // HACK: turn off the call back wilst we update the text or we recurse ourselves into oblivion
+ enableTextCallbacks ( FALSE );
+ updateTextEntry ();
+ enableTextCallbacks ( TRUE );
}
+
+ return TRUE;
}
+
// dispatch to base class for the rest of things
- return LLFloater::handleMouseDown ( x, y, mask );
+ return ret;
}
//////////////////////////////////////////////////////////////////////////////