From d6f1ba31da4a40d62fe781419cdd7db9843f6a30 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 21 Feb 2023 14:44:45 +0200 Subject: SL-19105 Updated icons, menus and Received items panel visibility in single-folder mode --- indra/newview/llpanelmaininventory.cpp | 57 ++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 10 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index d13c691abd..5b7678987e 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1278,6 +1278,20 @@ void LLPanelMainInventory::onViewModeClick() mActivePanel = mSingleFolderMode ? getChild("single_folder_inv") : (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); updateTitle(); + + LLSidepanelInventory* sidepanel_inventory = getParentSidepanelInventory(); + if (sidepanel_inventory) + { + if(mSingleFolderMode) + { + sidepanel_inventory->hideInbox(); + } + else + { + sidepanel_inventory->toggleInbox(); + } + } + } void LLPanelMainInventory::onUpFolderClicked() @@ -1623,16 +1637,6 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(trash_id); return children != LLInventoryModel::CHILDREN_NO && gInventory.isCategoryComplete(trash_id); } - if (command_name == "open_folder") - { - LLFolderView* root = getActivePanel()->getRootFolder(); - std::set selection_set = root->getSelectionList(); - if (selection_set.size() != 1) return FALSE; - LLFolderViewItem* current_item = *selection_set.begin(); - if (!current_item) return FALSE; - const LLUUID& folder_id = static_cast(current_item->getViewModelItem())->getUUID(); - return (gInventory.getCategory(folder_id) != NULL); - } return TRUE; } @@ -1648,6 +1652,16 @@ bool LLPanelMainInventory::isActionVisible(const LLSD& userdata) { return !mSingleFolderMode; } + if (param_str == "open_folder") + { + LLFolderView* root = getActivePanel()->getRootFolder(); + std::set selection_set = root->getSelectionList(); + if (selection_set.size() != 1) return FALSE; + LLFolderViewItem* current_item = *selection_set.begin(); + if (!current_item) return FALSE; + const LLUUID& folder_id = static_cast(current_item->getViewModelItem())->getUUID(); + return (gInventory.getCategory(folder_id) != NULL); + } return true; } @@ -1695,6 +1709,19 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LINKS) != 0; } + if (command_name == "list_view") + { + return true; + } + if (command_name == "gallery_view") + { + return false; + } + if (command_name == "combination_view") + { + return false; + } + return FALSE; } @@ -1737,5 +1764,15 @@ void LLPanelMainInventory::updateTitle() } } } + +LLSidepanelInventory* LLPanelMainInventory::getParentSidepanelInventory() +{ + LLFloaterSidePanelContainer* inventory_container = dynamic_cast(gFloaterView->getParentFloater(this)); + if(inventory_container) + { + return dynamic_cast(inventory_container->findChild("main_panel", true)); + } + return NULL; +} // List Commands // //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3