diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-30 15:04:49 +0300 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-03-30 15:04:49 +0300 |
commit | c15ee792a7248cf141abb3ae6a26b33a5aca1ed7 (patch) | |
tree | c563ab45647a82a209d5323c13cfa88b8a9a9930 | |
parent | 198cd4df09d4d6aa9c5bbb6be9c4395d134f9f13 (diff) |
SL-19379 WIP allow hide link items in search result
-rw-r--r-- | indra/newview/llinventorygallery.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llinventorygallery.h | 5 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 18 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml | 2 |
5 files changed, 45 insertions, 5 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index ad4124ff5b..0fc7816f59 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -84,7 +84,8 @@ LLInventoryGallery::LLInventoryGallery(const LLInventoryGallery::Params& p) mRowPanWidthFactor(p.row_panel_width_factor), mGalleryWidthFactor(p.gallery_width_factor), mIsInitialized(false), - mSearchType(LLInventoryFilter::SEARCHTYPE_NAME) + mSearchType(LLInventoryFilter::SEARCHTYPE_NAME), + mSearchLinks(true) { updateGalleryWidth(); @@ -561,6 +562,11 @@ void LLInventoryGallery::applyFilter(LLInventoryGalleryItem* item, const std::st if (!item) return; std::string desc; + if(!mSearchLinks && item->isLink()) + { + item->setHidden(true); + return; + } switch(mSearchType) { @@ -593,6 +599,18 @@ void LLInventoryGallery::setSearchType(LLInventoryFilter::ESearchType type) if(mSearchType != type) { mSearchType = type; + if(!mFilterSubString.empty()) + { + reArrangeRows(); + } + } +} + +void LLInventoryGallery::toggleSearchLinks() +{ + mSearchLinks = !mSearchLinks; + if(!mFilterSubString.empty()) + { reArrangeRows(); } } @@ -940,6 +958,7 @@ LLInventoryGalleryItem::LLInventoryGalleryItem(const Params& p) mName(""), mUUID(LLUUID()), mIsFolder(true), + mIsLink(false), mGallery(NULL), mType(LLAssetType::AT_NONE), mSortGroup(SG_ITEM) @@ -964,6 +983,7 @@ void LLInventoryGalleryItem::setType(LLAssetType::EType type, LLInventoryType::E { mType = type; mIsFolder = (mType == LLAssetType::AT_CATEGORY); + mIsLink = is_link; std::string icon_name = LLInventoryIcon::getIconName(mType, inventory_type, flags); if(mIsFolder) diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index 9d1a277c65..02e706eecd 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -111,6 +111,8 @@ public: void setSearchType(LLInventoryFilter::ESearchType type); LLInventoryFilter::ESearchType getSearchType() { return mSearchType; } + void toggleSearchLinks(); + bool getSearchLinks(){ return mSearchLinks; } protected: @@ -187,6 +189,7 @@ private: std::map<LLInventoryGalleryItem*, S32> mItemIndexMap; LLInventoryFilter::ESearchType mSearchType; + bool mSearchLinks; }; class LLInventoryGalleryItem : public LLPanel @@ -241,6 +244,7 @@ public: void setThumbnail(LLUUID id); void setGallery(LLInventoryGallery* gallery) { mGallery = gallery; } bool isFolder() { return mIsFolder; } + bool isLink() { return mIsLink; } EInventorySortGroup getSortGroup() { return mSortGroup; } private: @@ -251,6 +255,7 @@ private: bool mDefaultImage; bool mHidden; bool mIsFolder; + bool mIsLink; std::string mAssetIDStr; std::string mDesc; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index c40c5930c4..cc2c17d17d 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1723,7 +1723,14 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) if (command_name == "include_links") { - mActivePanel->getFilter().toggleSearchVisibilityLinks(); + if(mSingleFolderMode && isGalleryViewMode()) + { + mInventoryGalleryPanel->toggleSearchLinks(); + } + else + { + mActivePanel->getFilter().toggleSearchVisibilityLinks(); + } } if (command_name == "list_view") @@ -1911,7 +1918,14 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) if (command_name == "include_links") { - return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LINKS) != 0; + if(mSingleFolderMode && isGalleryViewMode()) + { + return mInventoryGalleryPanel->getSearchLinks(); + } + else + { + return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LINKS) != 0; + } } if (command_name == "list_view") diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index e6f670aa39..e8a19d3f1f 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3252,7 +3252,8 @@ See https://wiki.secondlife.com/wiki/Adding_Spelling_Dictionaries label="Rename Selected Item" name="RenameItem" type="alertmodal"> - Choose a new name for [NAME] + Choose a new name for: +[NAME] <tag>confirm</tag> <form name="form"> <input name="new_name" type="text" width="300"> diff --git a/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml b/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml index 1d216df094..281604503f 100644 --- a/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml +++ b/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml @@ -65,7 +65,7 @@ name="item_name" parse_urls="false" top="2" - width="130" + width="127" use_ellipses="true"> Item name, folder name. </text> |