diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-05-10 12:51:08 +0300 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-05-10 12:51:08 +0300 |
commit | 8a1cb8c00cf75ff1e09c72c2fb487728ec77c66b (patch) | |
tree | 02513f1ba4793148b52587fc58ff30b046e8cf98 /indra/newview | |
parent | 06f63d9b871458f71340ba7d0126bf964d17048f (diff) |
SL-19697 FIXED Clicking on inventory item in list view does not unselect item in gallery view
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventorygallery.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llinventorygallery.h | 1 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.h | 2 |
4 files changed, 31 insertions, 1 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 37801c8dd5..9c7e96e97e 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -1056,6 +1056,14 @@ void LLInventoryGallery::deselectItem(const LLUUID& category_id) } } +void LLInventoryGallery::clearSelection() +{ + if(mSelectedItemID != LLUUID::null) + { + changeItemSelection(LLUUID::null); + } +} + void LLInventoryGallery::signalSelectionItemID(const LLUUID& category_id) { mSelectionChangeSignal(category_id); diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index dfb7be6a86..f7065afdae 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -116,6 +116,7 @@ public: void computeDifference(const LLInventoryModel::cat_array_t vcats, const LLInventoryModel::item_array_t vitems, uuid_vec_t& vadded, uuid_vec_t& vremoved); void deselectItem(const LLUUID& category_id); + void clearSelection(); void changeItemSelection(const LLUUID& item_id, bool scroll_to_selection = false); void scrollToShowItem(const LLUUID& item_id); void signalSelectionItemID(const LLUUID& category_id); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 4577c1defa..a8c8ce994d 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -262,7 +262,7 @@ BOOL LLPanelMainInventory::postBuild() LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); comb_inv_filter.setFilterThumbnails(LLInventoryFilter::FILTER_EXCLUDE_THUMBNAILS); comb_inv_filter.markDefault(); - mCombinationInventoryPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mCombinationInventoryPanel, _1, _2)); + mCombinationInventoryPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onCombinationInventorySelectionChanged, this, _1, _2)); mCombinationInventoryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); mCombinationGalleryPanel = getChild<LLInventoryGallery>("comb_gallery_view_inv"); @@ -270,6 +270,7 @@ BOOL LLPanelMainInventory::postBuild() comb_gallery_filter.setFilterThumbnails(LLInventoryFilter::FILTER_ONLY_THUMBNAILS); comb_gallery_filter.markDefault(); mCombinationGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, true)); + mCombinationGalleryPanel->setSelectionChangeCallback(boost::bind(&LLPanelMainInventory::onCombinationGallerySelectionChanged, this, _1)); mCombinationScroller = getChild<LLView>("combination_scroller"); @@ -2296,6 +2297,24 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) mCombinationInventoryPanel->reshape(1, 1); } +void LLPanelMainInventory::onCombinationGallerySelectionChanged(const LLUUID& category_id) +{ + if(category_id != LLUUID::null) + { + mCombinationInventoryPanel->unSelectAll(); + } +} + +void LLPanelMainInventory::onCombinationInventorySelectionChanged(const std::deque<LLFolderViewItem*>& items, BOOL user_action) +{ + onSelectionChange(mCombinationInventoryPanel, items, user_action); + + if(!items.empty()) + { + mCombinationGalleryPanel->clearSelection(); + } +} + void LLPanelMainInventory::updateCombinationVisibility() { if(mSingleFolderMode diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 44beba6b4f..bc010ff37f 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -221,6 +221,8 @@ protected: void updateNavButtons(); void onCombinationRootChanged(bool gallery_clicked); + void onCombinationGallerySelectionChanged(const LLUUID& category_id); + void onCombinationInventorySelectionChanged(const std::deque<LLFolderViewItem*>& items, BOOL user_action); /** * Set upload cost in "Upload" sub menu. */ |