From 17d3f3786376578b765cd7a9b7f9a9e391e53cb9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 16 Feb 2023 21:33:14 +0200 Subject: SL-17640 Fix 'Apply now' being enabled when importing --- indra/newview/lltexturectrl.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 4849015e79..6c38550049 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -251,7 +251,9 @@ void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b) { mCanApplyImmediately = b; - getChild("apply_immediate_check")->setValue(mCanApplyImmediately); + LLUICtrl *apply_checkbox = getChild("apply_immediate_check"); + apply_checkbox->setValue(mCanApplyImmediately && gSavedSettings.getBOOL("TextureLivePreview")); + apply_checkbox->setEnabled(mCanApplyImmediately); } void LLFloaterTexturePicker::stopUsingPipette() @@ -528,7 +530,7 @@ BOOL LLFloaterTexturePicker::postBuild() mNoCopyTextureSelected = FALSE; - getChild("apply_immediate_check")->setValue(gSavedSettings.getBOOL("TextureLivePreview")); + getChild("apply_immediate_check")->setValue(mCanApplyImmediately && gSavedSettings.getBOOL("TextureLivePreview")); childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); getChildView("apply_immediate_check")->setEnabled(mCanApplyImmediately); @@ -862,7 +864,7 @@ void LLFloaterTexturePicker::onSelectionChange(const std::dequemPreviewSettingChanged) { - self->mCanPreview = gSavedSettings.getBOOL("TextureLivePreview"); + self->mCanPreview = self->mCanApplyImmediately && gSavedSettings.getBOOL("TextureLivePreview"); } else { @@ -1184,7 +1186,7 @@ void LLFloaterTexturePicker::setCanApply(bool can_preview, bool can_apply) getChildRef("apply_immediate_check").setVisible(can_preview); mCanApply = can_apply; - mCanPreview = can_preview ? gSavedSettings.getBOOL("TextureLivePreview") : false; + mCanPreview = can_preview ? (mCanApplyImmediately && gSavedSettings.getBOOL("TextureLivePreview")) : false; mPreviewSettingChanged = true; } -- cgit v1.2.3