From 559ce54d50ffffd9605be124e41d15acaf72c736 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 14 Nov 2024 19:33:24 +0200 Subject: #3072 don't update UI on cancel event from texture picker --- indra/newview/llfloaterregioninfo.cpp | 9 ++++++++- indra/newview/llfloaterregioninfo.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 3239921259..334f32d051 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -851,6 +851,13 @@ void LLPanelRegionInfo::initCtrl(const std::string& name) getChild(name)->setCommitCallback(boost::bind(&LLPanelRegionInfo::onChangeAnything, this)); } +void LLPanelRegionInfo::initAndSetTexCtrl(LLTextureCtrl*& ctrl, const std::string& name) +{ + ctrl = findChild(name); + if (ctrl) + ctrl->setOnSelectCallback([this](LLUICtrl* ctrl, const LLSD& param){ onChangeAnything(); }); +} + template void LLPanelRegionInfo::initAndSetCtrl(CTRL*& ctrl, const std::string& name) { @@ -1580,7 +1587,7 @@ bool LLPanelRegionTerrainInfo::postBuild() for(S32 i = 0; i < LLTerrainMaterials::ASSET_COUNT; ++i) { - initAndSetCtrl(mTextureDetailCtrl[i], llformat("texture_detail_%d", i)); + initAndSetTexCtrl(mTextureDetailCtrl[i], llformat("texture_detail_%d", i)); if (mTextureDetailCtrl[i]) { mTextureDetailCtrl[i]->setBakeTextureEnabled(false); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 201d8b0a68..a8631c36ca 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -159,6 +159,7 @@ public: protected: void initCtrl(const std::string& name); template void initAndSetCtrl(CTRL*& ctrl, const std::string& name); + void initAndSetTexCtrl(LLTextureCtrl*& ctrl, const std::string& name); // Returns true if update sent and apply button should be // disabled. -- cgit v1.2.3