diff options
-rwxr-xr-x | indra/newview/llcolorswatch.h | 3 | ||||
-rwxr-xr-x | indra/newview/llfloatercolorpicker.cpp | 14 |
2 files changed, 13 insertions, 4 deletions
diff --git a/indra/newview/llcolorswatch.h b/indra/newview/llcolorswatch.h index 5bdd1712d2..b3b6cfe32d 100755 --- a/indra/newview/llcolorswatch.h +++ b/indra/newview/llcolorswatch.h @@ -59,6 +59,7 @@ public: 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 @@ public: 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 @@ protected: BOOL mCanApplyImmediately; commit_callback_t mOnCancelCallback; commit_callback_t mOnSelectCallback; + commit_callback_t mPreviewCallback; S32 mLabelWidth; S32 mLabelHeight; diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index a03425649f..7ba7660f19 100755 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -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() |