summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatercolorpicker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatercolorpicker.cpp')
-rw-r--r--[-rwxr-xr-x]indra/newview/llfloatercolorpicker.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index 535cb368bd..ec2c9740af 100755..100644
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -173,6 +173,7 @@ 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" ) )
@@ -390,7 +391,10 @@ void LLFloaterColorPicker::onClickCancel ( void* data )
if ( self )
{
- self->cancelSelection ();
+ if(self->getRevertOnCancel())
+ {
+ self->cancelSelection ();
+ }
self->closeFloater();
}
}
@@ -447,8 +451,7 @@ void LLFloaterColorPicker::onImmediateCheck( LLUICtrl* ctrl, void* data)
if (self)
{
gSavedSettings.setBOOL("ApplyColorImmediately", self->mApplyImmediateCheck->get());
-
- if (self->mApplyImmediateCheck->get())
+ if (self->mApplyImmediateCheck->get() && self->isColorChanged())
{
LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
}
@@ -473,6 +476,11 @@ F32 LLFloaterColorPicker::getSwatchTransparency()
return getTransparencyType() == TT_ACTIVE ? 1.f : LLFloater::getCurrentTransparency();
}
+BOOL LLFloaterColorPicker::isColorChanged()
+{
+ return ((getOrigR() != getCurR()) || (getOrigG() != getCurG()) || (getOrigB() != getCurB()));
+}
+
//////////////////////////////////////////////////////////////////////////////
//
void LLFloaterColorPicker::draw()