From dbe5eb8a1dc18811f945f689f026cdcf180496dd Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 25 Jun 2019 17:54:21 +0300 Subject: SL-11431 [Legacy Profiles] Clicking someone else's profile picture should open image modal. --- indra/newview/lltexturectrl.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 1396a8546d..f5b96a3b5a 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -47,6 +47,7 @@ #include "llui.h" #include "llviewerinventory.h" #include "llpermissions.h" +#include "llpreviewtexture.h" #include "llsaleinfo.h" #include "llassetstorage.h" #include "lltextbox.h" @@ -997,6 +998,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mNeedsRawImageData( FALSE ), mValid( TRUE ), mShowLoadingPlaceholder( TRUE ), + mOpenTexPreview(false), mImageAssetID(p.image_id), mDefaultImageAssetID(p.default_image_id), mDefaultImageName(p.default_image_name), @@ -1249,12 +1251,31 @@ BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask) if (!handled && mBorder->parentPointInView(x, y)) { - showPicker(FALSE); - //grab textures first... - LLInventoryModelBackgroundFetch::instance().start(gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE)); - //...then start full inventory fetch. - LLInventoryModelBackgroundFetch::instance().start(); - handled = TRUE; + if (!mOpenTexPreview) + { + showPicker(FALSE); + //grab textures first... + LLInventoryModelBackgroundFetch::instance().start(gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE)); + //...then start full inventory fetch. + LLInventoryModelBackgroundFetch::instance().start(); + handled = TRUE; + } + else + { + if (getImageAssetID().notNull()) + { + LLPreviewTexture* preview_texture = LLFloaterReg::showTypedInstance("preview_texture", getValue()); + if (preview_texture && !preview_texture->isDependent()) + { + LLFloater* root_floater = gFloaterView->getParentFloater(this); + if (root_floater) + { + root_floater->addDependentFloater(preview_texture); + preview_texture->hideCtrlButtons(); + } + } + } + } } return handled; -- cgit v1.3 From 8df1856f84cf2d76b207ab43b05f1f930db50c51 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 31 Aug 2022 22:42:52 +0300 Subject: SL-17653 In texture picker cleaned up permanently invisible 'show folders' checkbox --- indra/newview/lltexturectrl.cpp | 24 ---------------------- indra/newview/lltexturectrl.h | 2 -- .../skins/default/xui/en/floater_texture_ctrl.xml | 11 +--------- 3 files changed, 1 insertion(+), 36 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index a26ac446c6..580fd7936e 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -410,10 +410,6 @@ BOOL LLFloaterTexturePicker::postBuild() childSetAction("None", LLFloaterTexturePicker::onBtnNone,this); childSetAction("Blank", LLFloaterTexturePicker::onBtnBlank,this); - - childSetCommitCallback("show_folders_check", onShowFolders, this); - getChildView("show_folders_check")->setVisible( FALSE); - mFilterEdit = getChild("inventory search editor"); mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2)); @@ -505,7 +501,6 @@ void LLFloaterTexturePicker::draw() updateImageStats(); // if we're inactive, gray out "apply immediate" checkbox - getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected); getChildView("Select")->setEnabled(mActive && mCanApply); getChildView("Pipette")->setEnabled(mActive); getChild("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); @@ -836,9 +831,6 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) self->getChild("inventory search editor")->setVisible(index == 0 ? TRUE : FALSE); self->getChild("inventory panel")->setVisible(index == 0 ? TRUE : FALSE); - /*self->getChild("show_folders_check")->setVisible(mode); - no idea under which conditions the above is even shown, needs testing. */ - self->getChild("l_add_btn")->setVisible(index == 1 ? TRUE : FALSE); self->getChild("l_rem_btn")->setVisible(index == 1 ? TRUE : FALSE); self->getChild("l_upl_btn")->setVisible(index == 1 ? TRUE : FALSE); @@ -1036,22 +1028,6 @@ void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl* ctrl, void* userdata) } } -// static -void LLFloaterTexturePicker::onShowFolders(LLUICtrl* ctrl, void *user_data) -{ - LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl; - LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data; - - if (check_box->get()) - { - picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - } - else - { - picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NO_FOLDERS); - } -} - // static void LLFloaterTexturePicker::onApplyImmediateCheck(LLUICtrl* ctrl, void *user_data) { diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 1bfbb0d1be..0325e09aa7 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -329,9 +329,7 @@ public: //static void onBtnRevert( void* userdata ); static void onBtnBlank(void* userdata); static void onBtnNone(void* userdata); - static void onBtnClear(void* userdata); void onSelectionChange(const std::deque &items, BOOL user_action); - static void onShowFolders(LLUICtrl* ctrl, void* userdata); static void onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata); void onTextureSelect(const LLTextureEntry& te); 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 18c226ed58..2a84fece03 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml @@ -175,22 +175,13 @@ bg_alpha_color="DkGray2" border="false" follows="all" - height="195" + height="200" layout="topleft" left_delta="0" name="inventory panel" top_pad="4" width="231" filter_asset_types="texture|material"/> -