From 9df7f5728b7dd33f3acca15ea6eceb99128b5f1f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 18 Mar 2020 21:08:34 +0200 Subject: SL-12870 Misleading UI value --- indra/newview/llfloaterimagepreview.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterimagepreview.cpp') diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index d4b0fa85ab..1728d81bbc 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -35,6 +35,7 @@ #include "llagent.h" #include "llbutton.h" +#include "llcheckboxctrl.h" #include "llcombobox.h" #include "lldrawable.h" #include "lldrawpoolavatar.h" @@ -115,8 +116,14 @@ BOOL LLFloaterImagePreview::postBuild() mSculptedPreview = new LLImagePreviewSculpted(256, 256); mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f); - if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF) - getChildView("lossless_check")->setEnabled(TRUE); + if (mRawImagep->getWidth() * mRawImagep->getHeight() <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF) + { + // We want "lossless_check" to be unchecked when it is disabled, regardless of + // LosslessJ2CUpload state, so only assign control when enabling checkbox + LLCheckBoxCtrl* check_box = getChild("lossless_check"); + check_box->setEnabled(TRUE); + check_box->setControlVariable(gSavedSettings.getControl("LosslessJ2CUpload")); + } } else { -- cgit v1.2.3