summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llcolorswatch.cpp18
-rw-r--r--indra/newview/llfloatercolorpicker.cpp6
-rw-r--r--indra/newview/llfloatercolorpicker.h5
3 files changed, 16 insertions, 13 deletions
diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp
index 80d810d159..036ff17074 100644
--- a/indra/newview/llcolorswatch.cpp
+++ b/indra/newview/llcolorswatch.cpp
@@ -290,9 +290,14 @@ void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op )
pickerp->getCurG (),
pickerp->getCurB (),
subject->mColor.mV[VALPHA] ); // keep current alpha
- subject->mColor = updatedColor;
- subject->setControlValue(updatedColor.getValue());
- pickerp->setRevertOnCancel(TRUE);
+
+ bool color_changed = subject->mColor != updatedColor;
+ if (color_changed)
+ {
+ subject->mColor = updatedColor;
+ subject->setControlValue(updatedColor.getValue());
+ }
+
if (pick_op == COLOR_CANCEL && subject->mOnCancelCallback)
{
subject->mOnCancelCallback( subject, LLSD());
@@ -306,6 +311,13 @@ void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op )
// just commit change
subject->onCommit ();
}
+
+ if (pick_op == COLOR_CANCEL || pick_op == COLOR_SELECT)
+ {
+ // both select and cancel close LLFloaterColorPicker
+ // but COLOR_CHANGE does not
+ subject->setFocus(TRUE);
+ }
}
}
}
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index 1a784223c2..1f0e8ee5fa 100644
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -173,7 +173,6 @@ void LLFloaterColorPicker::showUI ()
openFloater(getKey());
setVisible ( TRUE );
setFocus ( TRUE );
- setRevertOnCancel(FALSE);
// HACK: if system color picker is required - close the SL one we made and use default system dialog
if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) )
@@ -391,10 +390,7 @@ void LLFloaterColorPicker::onClickCancel ( void* data )
if ( self )
{
- if(self->getRevertOnCancel())
- {
- self->cancelSelection ();
- }
+ self->cancelSelection();
self->closeFloater();
}
}
diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h
index 16974a872e..39dbc5b763 100644
--- a/indra/newview/llfloatercolorpicker.h
+++ b/indra/newview/llfloatercolorpicker.h
@@ -104,9 +104,6 @@ class LLFloaterColorPicker
void setMouseDownInSwatch (BOOL mouse_down_in_swatch);
BOOL getMouseDownInSwatch () { return mMouseDownInSwatch; }
- void setRevertOnCancel (BOOL revertOnCancel) { mRevertOnCancel = revertOnCancel; };
- BOOL getRevertOnCancel () { return mRevertOnCancel; }
-
BOOL isColorChanged ();
// called when text entries (RGB/HSL etc.) are changed by user
@@ -149,8 +146,6 @@ class LLFloaterColorPicker
BOOL mMouseDownInHueRegion;
BOOL mMouseDownInSwatch;
- BOOL mRevertOnCancel;
-
const S32 mRGBViewerImageLeft;
const S32 mRGBViewerImageTop;
const S32 mRGBViewerImageWidth;