From 87b55e7293d7b87650e9e792f6be6b7e894773de Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 13 Sep 2022 01:15:31 +0300 Subject: SL-17653 Removed unneeded combo box --- indra/newview/llpanelface.cpp | 20 ++-- indra/newview/lltexturectrl.cpp | 101 ++++++--------------- indra/newview/lltexturectrl.h | 8 +- .../skins/default/xui/en/floater_texture_ctrl.xml | 93 +++++-------------- 4 files changed, 62 insertions(+), 160 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index ac4c76351d..28b8a64131 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1090,10 +1090,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) texture_ctrl->setTentative(FALSE); texture_ctrl->setEnabled(editable); texture_ctrl->setImageAssetID(id); - getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f); - getChildView("label alphamode")->setEnabled(editable && mIsAlpha); - getChildView("maskcutoff")->setEnabled(editable && mIsAlpha); - getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); + getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f && !has_pbr_material); + getChildView("label alphamode")->setEnabled(editable && mIsAlpha && !has_pbr_material); + getChildView("maskcutoff")->setEnabled(editable && mIsAlpha && !has_pbr_material); + getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha && !has_pbr_material); texture_ctrl->setBakeTextureEnabled(TRUE); } @@ -1116,10 +1116,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) texture_ctrl->setTentative(TRUE); texture_ctrl->setEnabled(editable); texture_ctrl->setImageAssetID(id); - getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f); - getChildView("label alphamode")->setEnabled(editable && mIsAlpha); - getChildView("maskcutoff")->setEnabled(editable && mIsAlpha); - getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); + getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f && !has_pbr_material); + getChildView("label alphamode")->setEnabled(editable && mIsAlpha && !has_pbr_material); + getChildView("maskcutoff")->setEnabled(editable && mIsAlpha && !has_pbr_material); + getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha && !has_pbr_material); texture_ctrl->setBakeTextureEnabled(TRUE); } @@ -1823,8 +1823,8 @@ void LLPanelFace::updateVisibility() // Diffuse texture controls getChildView("texture control")->setVisible(show_texture && show_material); - getChildView("label alphamode")->setVisible((show_texture && show_material) || show_pbr); - getChildView("combobox alphamode")->setVisible((show_texture && show_material) || show_pbr); + getChildView("label alphamode")->setVisible(show_texture && show_material); + getChildView("combobox alphamode")->setVisible(show_texture && show_material); getChildView("label maskcutoff")->setVisible(false); getChildView("maskcutoff")->setVisible(false); if ((show_texture && show_material) || show_pbr) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 2dad9cd2dc..b887b079ce 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -416,15 +416,6 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel = getChild("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("textures_material_combo"); - mTextureMaterialsCombo->setCommitCallback(onSelectTextureMaterials, this); - - // set the combo box to the first entry in the list (currently textures and materials) - mTextureMaterialsCombo->selectByValue(0); - mModeSelector = getChild("mode_selection"); mModeSelector->setCommitCallback(onModeSelect, this); mModeSelector->selectByValue(0); @@ -435,7 +426,7 @@ BOOL LLFloaterTexturePicker::postBuild() // selected at startup, we call the same function that is triggered // when a texture/materials/both choice is made and let it take care // of setting the filters - onSelectTextureMaterials(0, this); + refreshInventoryFilter(); mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); @@ -469,21 +460,7 @@ BOOL LLFloaterTexturePicker::postBuild() mLocalScrollCtrl = getChild("l_name_list"); mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit, this); - mLocalScrollCtrl->clearRows(); - - if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } - else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } - else if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) - { - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } + refreshLocalList(); mNoCopyTextureSelected = FALSE; @@ -843,7 +820,6 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) self->getChild("Blank")->setVisible(index == 0 ? TRUE : FALSE); self->getChild("None")->setVisible(index == 0 ? TRUE : FALSE); self->getChild("Pipette")->setVisible(index == 0 ? TRUE : FALSE); - self->getChild("textures_material_combo")->setVisible(index == 0 ? TRUE : FALSE); self->getChild("inventory search editor")->setVisible(index == 0 ? TRUE : FALSE); self->getChild("inventory panel")->setVisible(index == 0 ? TRUE : FALSE); @@ -963,21 +939,7 @@ void LLFloaterTexturePicker::onBtnRemove(void* userdata) self->getChild("l_rem_btn")->setEnabled(false); self->getChild("l_upl_btn")->setEnabled(false); - self->mLocalScrollCtrl->clearRows(); - - if (self->mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl); - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl); - } - else if (self->mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl); - } - else if (self->mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) - { - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl); - } + self->refreshLocalList(); } } @@ -1205,36 +1167,46 @@ void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string ) mInventoryPanel->setFilterSubString(search_string); } -void LLFloaterTexturePicker::onSelectTextureMaterials(LLUICtrl* ctrl, void *userdata) +void LLFloaterTexturePicker::refreshLocalList() { - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)userdata; - int index = self->mTextureMaterialsCombo->getValue().asInteger(); - - U32 filter_types = 0x0; + mLocalScrollCtrl->clearRows(); - if (self->mInventoryPickType != LLTextureCtrl::PICK_TEXTURE_MATERIAL) + if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL) + { + LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); + LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); + } + else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) + { + LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); + } + else if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) { - // mInventoryPickType overrides combo - index = self->mInventoryPickType; + LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); } +} - if (index == LLTextureCtrl::PICK_TEXTURE_MATERIAL) +void LLFloaterTexturePicker::refreshInventoryFilter() +{ + U32 filter_types = 0x0; + + if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE_MATERIAL) { filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; filter_types |= 0x1 << LLInventoryType::IT_MATERIAL; } - else if (index == LLTextureCtrl::PICK_TEXTURE) + else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) { filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; } - else if (index == LLTextureCtrl::PICK_MATERIAL) + else if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) { filter_types |= 0x1 << LLInventoryType::IT_MATERIAL; } - self->mInventoryPanel->setFilterTypes(filter_types); + mInventoryPanel->setFilterTypes(filter_types); } void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) @@ -1267,27 +1239,8 @@ void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled) void LLFloaterTexturePicker::setInventoryPickType(LLTextureCtrl::EPickInventoryType type) { 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) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } - else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE) - { - LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } - else if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL) - { - LLLocalGLTFMaterialMgr::getInstance()->feedScrollList(mLocalScrollCtrl); - } - - // refresh filters - onSelectTextureMaterials(0, this); + refreshLocalList(); + refreshInventoryFilter(); } void LLFloaterTexturePicker::onPickerCallback(const std::vector& filenames, LLHandle handle) diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 9cb86a2e74..0a5a281e76 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -78,8 +78,6 @@ 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, @@ -356,8 +354,6 @@ public: static void onBakeTextureSelect(LLUICtrl* ctrl, void *userdata); static void onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *userdata); - static void onSelectTextureMaterials(LLUICtrl* ctrl, void *userdata); - void setLocalTextureEnabled(BOOL enabled); void setBakeTextureEnabled(BOOL enabled); @@ -366,6 +362,9 @@ public: static void onPickerCallback(const std::vector& filenames, LLHandle handle); protected: + void refreshLocalList(); + void refreshInventoryFilter(); + LLPointer mTexturep; LLView* mOwner; @@ -387,7 +386,6 @@ protected: BOOL mActive; LLFilterEditor* mFilterEdit; - LLComboBox* mTextureMaterialsCombo; LLInventoryPanel* mInventoryPanel; PermissionMask mImmediateFilterPermMask; PermissionMask mDnDFilterPermMask; diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml index b6a2aaf31b..0cb69137e3 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml @@ -139,77 +139,28 @@ visible="false" width="87" /> - - - - - - - - - - - - - + +