summaryrefslogtreecommitdiff
path: root/indra/newview/llcolorswatch.cpp
diff options
context:
space:
mode:
authorCallum Linden <callum@lindenlab.com>2022-10-24 17:48:16 -0700
committerCallum Linden <callum@lindenlab.com>2022-10-24 17:48:16 -0700
commit80585d56fd6ccb0875c6353c7620a8ada749d66d (patch)
tree139699b14e49609532ca717f9086f2039795801e /indra/newview/llcolorswatch.cpp
parentb0d69a20c262441125261c4949e59a8a1b9e9628 (diff)
parente45b6159666b3aa271eaaa366fb4bcade2c2a28b (diff)
Merge master into DRTVWR-568 (and fix conflicts)
Diffstat (limited to 'indra/newview/llcolorswatch.cpp')
-rw-r--r--indra/newview/llcolorswatch.cpp18
1 files changed, 15 insertions, 3 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);
+ }
}
}
}