Skip to content
Snippets Groups Projects
Commit f023c677 authored by David Parks's avatar David Parks
Browse files

MAINT-3832 Make color pickers actually apply result immediately when "apply...

MAINT-3832 Make color pickers actually apply result immediately when "apply immediately" is checked.
parent 02423199
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ class LLColorSwatchCtrl
Optional<LLUIImage*> alpha_background_image;
Optional<commit_callback_t> cancel_callback;
Optional<commit_callback_t> select_callback;
Optional<commit_callback_t> preview_callback;
Optional<LLUIColor> border_color;
Optional<S32> label_width;
Optional<S32> label_height;
......@@ -87,6 +88,7 @@ class LLColorSwatchCtrl
void setCanApplyImmediately(BOOL apply) { mCanApplyImmediately = apply; }
void setOnCancelCallback(commit_callback_t cb) { mOnCancelCallback = cb; }
void setOnSelectCallback(commit_callback_t cb) { mOnSelectCallback = cb; }
void setPreviewCallback(commit_callback_t cb) { mPreviewCallback = cb; }
void setFallbackImageName(const std::string& name) { mFallbackImageName = name; }
void showPicker(BOOL take_focus);
......@@ -112,6 +114,7 @@ class LLColorSwatchCtrl
BOOL mCanApplyImmediately;
commit_callback_t mOnCancelCallback;
commit_callback_t mOnSelectCallback;
commit_callback_t mPreviewCallback;
S32 mLabelWidth;
S32 mLabelHeight;
......
......@@ -347,6 +347,11 @@ void LLFloaterColorPicker::setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn )
curG = curGIn;
curB = curBIn;
if (mApplyImmediateCheck->get())
{
LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
}
// update corresponding HSL values and
LLColor3(curRIn, curGIn, curBIn).calcHSL(&curH, &curS, &curL);
......@@ -374,6 +379,11 @@ void LLFloaterColorPicker::setCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn )
// update corresponding RGB values and
hslToRgb ( curH, curS, curL, curR, curG, curB );
if (mApplyImmediateCheck->get())
{
LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
}
}
//////////////////////////////////////////////////////////////////////////////
......@@ -463,10 +473,6 @@ void LLFloaterColorPicker::onImmediateCheck( LLUICtrl* ctrl, void* data)
void LLFloaterColorPicker::onColorSelect( const LLTextureEntry& te )
{
setCurRgb(te.getColor().mV[VRED], te.getColor().mV[VGREEN], te.getColor().mV[VBLUE]);
if (mApplyImmediateCheck->get())
{
LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
}
}
void LLFloaterColorPicker::onMouseCaptureLost()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment