summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-09-01 16:05:01 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-09-01 16:05:01 +0300
commitd2d257cfa99b685160e16ed93c163018e9fe3c50 (patch)
treedb814bd8388ce04819c0f70a3e1d3ccef87dfe02 /indra/newview
parent116bd660b65cfad64c6f9635db165cff5b3eda36 (diff)
SL-17653 Fix combo not being visible when needed
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lltexturectrl.cpp14
-rw-r--r--indra/newview/lltexturectrl.h2
2 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 87c05c162a..2dad9cd2dc 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -416,6 +416,9 @@ BOOL LLFloaterTexturePicker::postBuild()
mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
+ // if can select both materials and textures, set textures_material_combo's layout as visible
+ childSetVisible("combo_layout", mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL);
+
mTextureMaterialsCombo = getChild<LLComboBox>("textures_material_combo");
mTextureMaterialsCombo->setCommitCallback(onSelectTextureMaterials, this);
@@ -1207,16 +1210,11 @@ void LLFloaterTexturePicker::onSelectTextureMaterials(LLUICtrl* ctrl, void *user
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)userdata;
int index = self->mTextureMaterialsCombo->getValue().asInteger();
- // IMPORTANT: make sure these match the entries in floater_texture_ctrl.xml
- // for the textures_material_combo combo box
- const int textures_and_materials = 0;
- const int textures_only = 1;
- const int materials_only = 2;
-
U32 filter_types = 0x0;
if (self->mInventoryPickType != LLTextureCtrl::PICK_TEXTURE_MATERIAL)
{
+ // mInventoryPickType overrides combo
index = self->mInventoryPickType;
}
@@ -1270,6 +1268,9 @@ void LLFloaterTexturePicker::setInventoryPickType(LLTextureCtrl::EPickInventoryT
{
mInventoryPickType = type;
+ // if can select both materials and textures, set textures_material_combo's layout as visible
+ childSetVisible("combo_layout", mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL);
+
mLocalScrollCtrl->clearRows();
if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL)
{
@@ -1285,6 +1286,7 @@ void LLFloaterTexturePicker::setInventoryPickType(LLTextureCtrl::EPickInventoryT
LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl);
}
+ // refresh filters
onSelectTextureMaterials(0, this);
}
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index fb409af42b..9cb86a2e74 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -78,6 +78,8 @@ public:
TEXTURE_CANCEL
} ETexturePickOp;
+ // Should match the entries in floater_texture_ctrl.xml
+ // for the textures_material_combo combo box
typedef enum e_pick_inventory_type
{
PICK_TEXTURE_MATERIAL = 0,