From ac3f1b54ec6484442ea302570c14707e8bb263d2 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 1 Feb 2023 18:44:26 +0200 Subject: SL-19104 Clean up inventory UI to prepare for thumbnails (#66) --- indra/newview/llpanelmaininventory.cpp | 46 +++++++++++----------------------- 1 file changed, 15 insertions(+), 31 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 89256b40c4..b2953e9c99 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -113,7 +113,8 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mMenuGearDefault(NULL), mMenuVisibility(NULL), mMenuAddHandle(), - mNeedUploadCost(true) + mNeedUploadCost(true), + mMenuViewDefault(NULL) { // Menu Callbacks (non contex menus) mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelMainInventory::doToSelected, this, _2)); @@ -237,6 +238,7 @@ BOOL LLPanelMainInventory::postBuild() mGearMenuButton = getChild("options_gear_btn"); mVisibilityMenuButton = getChild("options_visibility_btn"); + mViewMenuButton = getChild("view_btn"); initListCommandsHandlers(); @@ -1163,21 +1165,15 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data) void LLPanelMainInventory::initListCommandsHandlers() { - childSetAction("trash_btn", boost::bind(&LLPanelMainInventory::onTrashButtonClick, this)); childSetAction("add_btn", boost::bind(&LLPanelMainInventory::onAddButtonClick, this)); - mTrashButton = getChild("trash_btn"); - mTrashButton->setDragAndDropHandler(boost::bind(&LLPanelMainInventory::handleDragAndDropToTrash, this - , _4 // BOOL drop - , _5 // EDragAndDropType cargo_type - , _7 // EAcceptance* accept - )); - mCommitCallbackRegistrar.add("Inventory.GearDefault.Custom.Action", boost::bind(&LLPanelMainInventory::onCustomAction, this, _2)); mEnableCallbackRegistrar.add("Inventory.GearDefault.Check", boost::bind(&LLPanelMainInventory::isActionChecked, this, _2)); mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2)); mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGearMenuButton->setMenu(mMenuGearDefault); + mMenuViewDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_view_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mViewMenuButton->setMenu(mMenuViewDefault); LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mMenuAddHandle = menu->getHandle(); @@ -1191,9 +1187,6 @@ void LLPanelMainInventory::initListCommandsHandlers() void LLPanelMainInventory::updateListCommands() { - bool trash_enabled = isActionEnabled("delete"); - - mTrashButton->setEnabled(trash_enabled); } void LLPanelMainInventory::onAddButtonClick() @@ -1227,11 +1220,6 @@ void LLPanelMainInventory::showActionMenu(LLMenuGL* menu, std::string spawning_v } } -void LLPanelMainInventory::onTrashButtonClick() -{ - onClipboardAction("delete"); -} - void LLPanelMainInventory::onClipboardAction(const LLSD& userdata) { std::string command_name = userdata.asString(); @@ -1375,6 +1363,11 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) LLFloaterReg::showInstance("linkreplace", params); } + if (command_name == "toggle_search_outfits") + { + mActivePanel->getFilter().toggleSearchVisibilityOutfits(); + } + if (command_name == "toggle_search_trash") { mActivePanel->getFilter().toggleSearchVisibilityTrash(); @@ -1534,6 +1527,11 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) return sort_order_mask & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP; } + if (command_name == "toggle_search_outfits") + { + return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_OUTFITS) != 0; + } + if (command_name == "toggle_search_trash") { return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_TRASH) != 0; @@ -1552,20 +1550,6 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) return FALSE; } -bool LLPanelMainInventory::handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept) -{ - *accept = ACCEPT_NO; - - const bool is_enabled = isActionEnabled("delete"); - if (is_enabled) *accept = ACCEPT_YES_MULTI; - - if (is_enabled && drop) - { - onClipboardAction("delete"); - } - return true; -} - void LLPanelMainInventory::setUploadCostIfNeeded() { LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get(); -- cgit v1.2.3 From 734b1b5d421254c45b3eb0fe0a5bbc8159e489fc Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 17 Feb 2023 15:47:03 +0200 Subject: SL-19105 WIP Single-folder inventory view --- indra/newview/llpanelmaininventory.cpp | 173 +++++++++++++++++++++++++++++++-- 1 file changed, 167 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a517fae0a5..d13c691abd 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -38,7 +38,6 @@ #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" -#include "llinventorypanel.h" #include "llfiltereditor.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterreg.h" @@ -114,7 +113,9 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mMenuVisibility(NULL), mMenuAddHandle(), mNeedUploadCost(true), - mMenuViewDefault(NULL) + mMenuViewDefault(NULL), + mSingleFolderMode(false), + mFolderRootChangedConnection() { // Menu Callbacks (non contex menus) mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelMainInventory::doToSelected, this, _2)); @@ -240,6 +241,9 @@ BOOL LLPanelMainInventory::postBuild() mVisibilityMenuButton = getChild("options_visibility_btn"); mViewMenuButton = getChild("view_btn"); + mSingleFolderPanelInventory = getChild("single_folder_inv"); + mFolderRootChangedConnection = mSingleFolderPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); + initListCommandsHandlers(); const std::string texture_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost()); @@ -316,6 +320,11 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) menu->die(); mMenuAddHandle.markDead(); } + + if (mFolderRootChangedConnection.connected()) + { + mFolderRootChangedConnection.disconnect(); + } } LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel() @@ -383,10 +392,17 @@ void LLPanelMainInventory::closeAllFolders() getPanel()->getRootFolder()->closeAllFolders(); } +S32 get_instance_num() +{ + static S32 instance_num = 0; + instance_num = (instance_num + 1) % S32_MAX; + + return instance_num; +} + void LLPanelMainInventory::newWindow() { - static S32 instance_num = 0; - instance_num = (instance_num + 1) % S32_MAX; + S32 instance_num = get_instance_num(); if (!gAgentCamera.cameraMouselook()) { @@ -394,10 +410,45 @@ void LLPanelMainInventory::newWindow() } } +void LLPanelMainInventory::newFolderWindow(const LLUUID& folder_id) +{ + S32 instance_num = get_instance_num(); + + LLFloaterSidePanelContainer* inventory_container = LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); + if(inventory_container) + { + LLSidepanelInventory* sidepanel_inventory = dynamic_cast(inventory_container->findChild("main_panel", true)); + if (sidepanel_inventory) + { + LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); + if (main_inventory) + { + main_inventory->onViewModeClick(); + if(folder_id.notNull()) + { + main_inventory->setSingleFolderViewRoot(folder_id); + } + } + } + } +} + void LLPanelMainInventory::doCreate(const LLSD& userdata) { reset_inventory_filter(); - menu_create_inventory_item(getPanel(), NULL, userdata); + if(mSingleFolderMode) + { + LLFolderViewItem* current_folder = getActivePanel()->getRootFolder(); + if (current_folder) + { + LLFolderBridge* bridge = (LLFolderBridge*)current_folder->getViewModelItem(); + menu_create_inventory_item(getPanel(), bridge, userdata); + } + } + else + { + menu_create_inventory_item(getPanel(), NULL, userdata); + } } void LLPanelMainInventory::resetFilters() @@ -527,7 +578,7 @@ void LLPanelMainInventory::onClearSearch() } // re-open folders that were initially open in case filter was active - if (mActivePanel && (mFilterSubString.size() || initially_active)) + if (mActivePanel && (mFilterSubString.size() || initially_active) && !mSingleFolderMode) { mSavedFolderState->setApply(TRUE); mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState); @@ -1173,10 +1224,15 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data) void LLPanelMainInventory::initListCommandsHandlers() { childSetAction("add_btn", boost::bind(&LLPanelMainInventory::onAddButtonClick, this)); + childSetAction("view_mode_btn", boost::bind(&LLPanelMainInventory::onViewModeClick, this)); + childSetAction("up_btn", boost::bind(&LLPanelMainInventory::onUpFolderClicked, this)); + childSetAction("back_btn", boost::bind(&LLPanelMainInventory::onBackFolderClicked, this)); + childSetAction("forward_btn", boost::bind(&LLPanelMainInventory::onForwardFolderClicked, this)); mCommitCallbackRegistrar.add("Inventory.GearDefault.Custom.Action", boost::bind(&LLPanelMainInventory::onCustomAction, this, _2)); mEnableCallbackRegistrar.add("Inventory.GearDefault.Check", boost::bind(&LLPanelMainInventory::isActionChecked, this, _2)); mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2)); + mEnableCallbackRegistrar.add("Inventory.GearDefault.Visible", boost::bind(&LLPanelMainInventory::isActionVisible, this, _2)); mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGearMenuButton->setMenu(mMenuGearDefault, LLMenuButton::MP_TOP_LEFT, true); mMenuViewDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_view_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); @@ -1211,6 +1267,47 @@ void LLPanelMainInventory::onAddButtonClick() } } +void LLPanelMainInventory::onViewModeClick() +{ + mSingleFolderMode = !mSingleFolderMode; + + getChild("default_inventory_panel")->setVisible(!mSingleFolderMode); + getChild("single_folder_inventory")->setVisible(mSingleFolderMode); + getChild("nav_buttons")->setVisible(mSingleFolderMode); + getChild("view_mode_btn")->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); + + mActivePanel = mSingleFolderMode ? getChild("single_folder_inv") : (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); + updateTitle(); +} + +void LLPanelMainInventory::onUpFolderClicked() +{ + const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); + if (cat) + { + if (cat->getParentUUID().notNull()) + { + mSingleFolderPanelInventory->changeFolderRoot(cat->getParentUUID()); + } + } +} + +void LLPanelMainInventory::onBackFolderClicked() +{ + mSingleFolderPanelInventory->onBackwardFolder(); +} + +void LLPanelMainInventory::onForwardFolderClicked() +{ + mSingleFolderPanelInventory->onForwardFolder(); +} + +void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id) +{ + mSingleFolderPanelInventory->changeFolderRoot(folder_id); + mSingleFolderPanelInventory->clearNavigationHistory(); +} + void LLPanelMainInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) { if (menu) @@ -1254,6 +1351,27 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) return; const std::string command_name = userdata.asString(); + if (command_name == "new_single_folder_window") + { + newFolderWindow(LLUUID()); + } + if ((command_name == "open_in_current_window") || (command_name == "open_in_new_window")) + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + const LLUUID& folder_id = static_cast(current_item->getViewModelItem())->getUUID(); + if((command_name == "open_in_current_window")) + { + mSingleFolderPanelInventory->changeFolderRoot(folder_id); + } + if((command_name == "open_in_new_window")) + { + newFolderWindow(folder_id); + } + } if (command_name == "new_window") { newWindow(); @@ -1505,10 +1623,34 @@ 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; } +bool LLPanelMainInventory::isActionVisible(const LLSD& userdata) +{ + const std::string param_str = userdata.asString(); + if (param_str == "single_folder_view") + { + return mSingleFolderMode; + } + if (param_str == "multi_folder_view") + { + return !mSingleFolderMode; + } + return true; +} + BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) { U32 sort_order_mask = getActivePanel()->getSortOrder(); @@ -1576,5 +1718,24 @@ bool LLPanelMainInventory::hasSettingsInventory() return LLEnvironment::instance().isInventoryEnabled(); } +void LLPanelMainInventory::updateTitle() +{ + LLFloater* inventory_floater = gFloaterView->getParentFloater(this); + if(inventory_floater) + { + if(mSingleFolderMode) + { + const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); + if (cat) + { + inventory_floater->setTitle(cat->getName()); + } + } + else + { + inventory_floater->setTitle(getString("inventory_title")); + } + } +} // List Commands // //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 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 From 7904649923eddb1291c336ac59b51b78e90c9137 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 22 Feb 2023 20:29:01 +0200 Subject: SL-19105 Update menu items; show items count on selection in single-folder mode --- indra/newview/llpanelmaininventory.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5b7678987e..2b32bd649e 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -243,6 +243,7 @@ BOOL LLPanelMainInventory::postBuild() mSingleFolderPanelInventory = getChild("single_folder_inv"); mFolderRootChangedConnection = mSingleFolderPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); + mSingleFolderPanelInventory->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mSingleFolderPanelInventory, _1, _2)); initListCommandsHandlers(); @@ -1652,13 +1653,16 @@ bool LLPanelMainInventory::isActionVisible(const LLSD& userdata) { return !mSingleFolderMode; } - if (param_str == "open_folder") + if (param_str == "open_folder" || param_str == "open_new_folder") { + if (!mSingleFolderMode && (param_str == "open_folder")) return false; + LLFolderView* root = getActivePanel()->getRootFolder(); std::set selection_set = root->getSelectionList(); - if (selection_set.size() != 1) return FALSE; + if (selection_set.size() != 1) return false; + LLFolderViewItem* current_item = *selection_set.begin(); - if (!current_item) return FALSE; + if (!current_item) return false; const LLUUID& folder_id = static_cast(current_item->getViewModelItem())->getUUID(); return (gInventory.getCategory(folder_id) != NULL); } -- cgit v1.2.3 From e9ba3a1d437935cf7fe0756928896c929758dc54 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 22 Feb 2023 21:18:53 +0200 Subject: SL-19246 FIXED Search text from 'New inventory' applies to Received items from main Inventory --- indra/newview/llpanelmaininventory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 2b32bd649e..fa40f13d00 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -589,7 +589,7 @@ void LLPanelMainInventory::onClearSearch() } mFilterSubString = ""; - LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); + LLSidepanelInventory * sidepanel_inventory = getParentSidepanelInventory(); if (sidepanel_inventory) { LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild("marketplace_inbox"); @@ -630,7 +630,7 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) // set new filter string setFilterSubString(mFilterSubString); - LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); + LLSidepanelInventory * sidepanel_inventory = getParentSidepanelInventory(); if (sidepanel_inventory) { LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild("marketplace_inbox"); -- cgit v1.2.3 From 49da5288bd0425241823186bfd56a159fe2f9a60 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 24 Feb 2023 03:05:30 +0200 Subject: SL-19234 add Inventory settings floater --- indra/newview/llpanelmaininventory.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index fa40f13d00..0fd4eb0c15 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -411,7 +411,7 @@ void LLPanelMainInventory::newWindow() } } -void LLPanelMainInventory::newFolderWindow(const LLUUID& folder_id) +void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_select) { S32 instance_num = get_instance_num(); @@ -428,6 +428,10 @@ void LLPanelMainInventory::newFolderWindow(const LLUUID& folder_id) if(folder_id.notNull()) { main_inventory->setSingleFolderViewRoot(folder_id); + if(item_to_select.notNull()) + { + sidepanel_inventory->getActivePanel()->setSelection(item_to_select, TAKE_FOCUS_YES); + } } } } @@ -1368,7 +1372,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) const std::string command_name = userdata.asString(); if (command_name == "new_single_folder_window") { - newFolderWindow(LLUUID()); + newFolderWindow(); } if ((command_name == "open_in_current_window") || (command_name == "open_in_new_window")) { -- cgit v1.2.3 From f377e27f0b8ddabf755c6efe71d6bc0e53e751c1 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 27 Feb 2023 20:27:11 +0200 Subject: SL-19274 Add new double-click option to Inventory settings --- indra/newview/llpanelmaininventory.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 0fd4eb0c15..5da53cc928 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1321,10 +1321,13 @@ void LLPanelMainInventory::onForwardFolderClicked() mSingleFolderPanelInventory->onForwardFolder(); } -void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id) +void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool clear_nav_history) { mSingleFolderPanelInventory->changeFolderRoot(folder_id); - mSingleFolderPanelInventory->clearNavigationHistory(); + if(clear_nav_history) + { + mSingleFolderPanelInventory->clearNavigationHistory(); + } } void LLPanelMainInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) -- cgit v1.2.3 From ba1872e57106c7a27a0f73453ace499f42c48345 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 28 Feb 2023 02:32:23 +0200 Subject: =?UTF-8?q?SL-19271=20Remove=20=E2=80=98New=20folder=20window?= =?UTF-8?q?=E2=80=99,=20=E2=80=98Open=20in=20new=20window=E2=80=99=20and?= =?UTF-8?q?=20=E2=80=98Open=E2=80=99=20from=20Gear=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llpanelmaininventory.cpp | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5da53cc928..9bfea7fe2b 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1373,27 +1373,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) return; const std::string command_name = userdata.asString(); - if (command_name == "new_single_folder_window") - { - newFolderWindow(); - } - if ((command_name == "open_in_current_window") || (command_name == "open_in_new_window")) - { - LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); - if (!current_item) - { - return; - } - const LLUUID& folder_id = static_cast(current_item->getViewModelItem())->getUUID(); - if((command_name == "open_in_current_window")) - { - mSingleFolderPanelInventory->changeFolderRoot(folder_id); - } - if((command_name == "open_in_new_window")) - { - newFolderWindow(folder_id); - } - } + if (command_name == "new_window") { newWindow(); @@ -1660,19 +1640,7 @@ bool LLPanelMainInventory::isActionVisible(const LLSD& userdata) { return !mSingleFolderMode; } - if (param_str == "open_folder" || param_str == "open_new_folder") - { - if (!mSingleFolderMode && (param_str == "open_folder")) return false; - - 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; } -- cgit v1.2.3 From 46531cea8475741f9144f787fec8be371de082e6 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 28 Feb 2023 14:35:44 +0200 Subject: SL-19285 Add 'Close all windows' to Gear menu --- indra/newview/llpanelmaininventory.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 9bfea7fe2b..6b7e447e69 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1489,6 +1489,20 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) LLFloaterReg::showInstance("linkreplace", params); } + if (command_name == "close_inv_windows") + { + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end();) + { + LLFloaterSidePanelContainer* iv = dynamic_cast(*iter++); + if (iv) + { + iv->closeFloater(); + } + } + LLFloaterReg::hideInstance("inventory_settings"); + } + if (command_name == "toggle_search_outfits") { mActivePanel->getFilter().toggleSearchVisibilityOutfits(); -- cgit v1.2.3 From 82dcda526a962953b9e7fb6405d22b263b562a08 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 28 Feb 2023 16:12:45 +0200 Subject: SL-19285 Gear and Sort menus should be opened downward --- indra/newview/llpanelmaininventory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 6b7e447e69..fd245a2b4d 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1239,9 +1239,9 @@ void LLPanelMainInventory::initListCommandsHandlers() mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2)); mEnableCallbackRegistrar.add("Inventory.GearDefault.Visible", boost::bind(&LLPanelMainInventory::isActionVisible, this, _2)); mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - mGearMenuButton->setMenu(mMenuGearDefault, LLMenuButton::MP_TOP_LEFT, true); + mGearMenuButton->setMenu(mMenuGearDefault, LLMenuButton::MP_BOTTOM_LEFT, true); mMenuViewDefault = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_view_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - mViewMenuButton->setMenu(mMenuViewDefault); + mViewMenuButton->setMenu(mMenuViewDefault, LLMenuButton::MP_BOTTOM_LEFT, true); LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mMenuAddHandle = menu->getHandle(); -- cgit v1.2.3 From c74658b19b1ac28d5bf240e940a7ad97ff034e3c Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 2 Mar 2023 20:54:33 +0200 Subject: SL-19310 Update navigation buttons in single-folder view --- indra/newview/llpanelmaininventory.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index fd245a2b4d..1eb2d5bbdc 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -374,6 +374,10 @@ BOOL LLPanelMainInventory::handleKeyHere(KEY key, MASK mask) { startSearch(); } + if(mSingleFolderMode && key == KEY_LEFT) + { + onBackFolderClicked(); + } } return LLPanel::handleKeyHere(key, mask); @@ -1327,6 +1331,7 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool if(clear_nav_history) { mSingleFolderPanelInventory->clearNavigationHistory(); + updateNavButtons(); } } @@ -1756,6 +1761,17 @@ void LLPanelMainInventory::updateTitle() inventory_floater->setTitle(getString("inventory_title")); } } + updateNavButtons(); +} + +void LLPanelMainInventory::updateNavButtons() +{ + getChild("back_btn")->setEnabled(mSingleFolderPanelInventory->isBackwardAvailable()); + getChild("forward_btn")->setEnabled(mSingleFolderPanelInventory->isForwardAvailable()); + + const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); + bool up_enabled = (cat && cat->getParentUUID().notNull()); + getChild("up_btn")->setEnabled(up_enabled); } LLSidepanelInventory* LLPanelMainInventory::getParentSidepanelInventory() -- cgit v1.2.3 From bb964fb49512abcce7018c339d752cc35240816d Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 3 Mar 2023 18:39:29 +0200 Subject: SL-19334 Show item count info only for items in current folder in single-folder view --- indra/newview/llpanelmaininventory.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 1eb2d5bbdc..6b9e04840d 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -825,6 +825,17 @@ void LLPanelMainInventory::updateItemcountText() { text = getString("ItemcountUnknown", string_args); } + + if (mSingleFolderMode) + { + LLInventoryModel::cat_array_t *cats; + LLInventoryModel::item_array_t *items; + gInventory.getDirectDescendentsOf(mSingleFolderPanelInventory->getSingleFolderRoot(), cats, items); + + string_args["[ITEM_COUNT]"] = llformat("%d", items->size()); + string_args["[CATEGORY_COUNT]"] = llformat("%d", cats->size()); + text = getString("ItemcountCompleted", string_args); + } mCounterCtrl->setValue(text); mCounterCtrl->setToolTip(text); -- cgit v1.2.3 From ea94cda5f5bb9a426782ee7c7aebb1095ba444c1 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 7 Mar 2023 19:30:30 +0200 Subject: =?UTF-8?q?SL-19356=20bring=20SFV=20to=20the=20top=20instead=20of?= =?UTF-8?q?=20opening=20a=20new=20window=20if=20there=E2=80=99s=20already?= =?UTF-8?q?=20one=20open=20for=20that=20folder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llpanelmaininventory.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 6b9e04840d..a3ac64aee8 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -415,8 +415,33 @@ void LLPanelMainInventory::newWindow() } } +//static void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_select) { + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end();) + { + LLFloaterSidePanelContainer* inventory_container = dynamic_cast(*iter++); + if (inventory_container) + { + LLSidepanelInventory* sidepanel_inventory = dynamic_cast(inventory_container->findChild("main_panel", true)); + if (sidepanel_inventory) + { + LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); + if (main_inventory && main_inventory->isSingleFolderMode() + && (main_inventory->getSingleFolderViewRoot() == folder_id)) + { + main_inventory->setFocus(true); + if(item_to_select.notNull()) + { + sidepanel_inventory->getActivePanel()->setSelection(item_to_select, TAKE_FOCUS_YES); + } + return; + } + } + } + } + S32 instance_num = get_instance_num(); LLFloaterSidePanelContainer* inventory_container = LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); @@ -1346,6 +1371,11 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool } } +LLUUID LLPanelMainInventory::getSingleFolderViewRoot() +{ + return mSingleFolderPanelInventory->getSingleFolderRoot(); +} + void LLPanelMainInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) { if (menu) -- cgit v1.2.3 From fa50ce4b1054a453a97a81d64eb8099cae6f4cb5 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 9 Mar 2023 16:22:50 +0200 Subject: =?UTF-8?q?SL-19373=20Show=20folder=20name=20in=20filter=20floater?= =?UTF-8?q?=E2=80=99s=20title=20bar=20in=20single-folder=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llpanelmaininventory.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a3ac64aee8..ac188abb05 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -718,7 +718,7 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) void LLPanelMainInventory::onFilterSelected() { // Find my index - mActivePanel = (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); + mActivePanel = mSingleFolderMode ? getChild("single_folder_inv") : (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); if (!mActivePanel) { @@ -736,6 +736,14 @@ void LLPanelMainInventory::onFilterSelected() if (finder) { finder->changeFilter(&filter); + if (mSingleFolderMode) + { + const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); + if (cat) + { + finder->setTitle(cat->getName()); + } + } } if (filter.isActive()) { @@ -897,6 +905,15 @@ void LLPanelMainInventory::toggleFindOptions() parent_floater->addDependentFloater(mFinderHandle); // start background fetch of folders LLInventoryModelBackgroundFetch::instance().start(); + + if (mSingleFolderMode) + { + const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); + if (cat) + { + finder->setTitle(cat->getName()); + } + } } else { @@ -1323,6 +1340,7 @@ void LLPanelMainInventory::onViewModeClick() mActivePanel = mSingleFolderMode ? getChild("single_folder_inv") : (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); updateTitle(); + onFilterSelected(); LLSidepanelInventory* sidepanel_inventory = getParentSidepanelInventory(); if (sidepanel_inventory) @@ -1795,6 +1813,11 @@ void LLPanelMainInventory::updateTitle() if (cat) { inventory_floater->setTitle(cat->getName()); + LLFloaterInventoryFinder *finder = getFinder(); + if (finder) + { + finder->setTitle(cat->getName()); + } } } else -- cgit v1.2.3 From e364b90d61b7711c088d9bca7307e3760f28c59d Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 10 Mar 2023 17:39:24 +0200 Subject: SL-19335 Switching view (using the switch button) should select appropriate folder --- indra/newview/llpanelmaininventory.cpp | 58 ++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index ac188abb05..f8c1fcb5f5 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -453,7 +453,7 @@ void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_sele LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); if (main_inventory) { - main_inventory->onViewModeClick(); + main_inventory->toggleViewMode(); if(folder_id.notNull()) { main_inventory->setSingleFolderViewRoot(folder_id); @@ -1329,7 +1329,7 @@ void LLPanelMainInventory::onAddButtonClick() } } -void LLPanelMainInventory::onViewModeClick() +void LLPanelMainInventory::toggleViewMode() { mSingleFolderMode = !mSingleFolderMode; @@ -1354,7 +1354,61 @@ void LLPanelMainInventory::onViewModeClick() sidepanel_inventory->toggleInbox(); } } +} +void LLPanelMainInventory::onViewModeClick() +{ + LLUUID selected_folder; + LLUUID new_root_folder; + if(mSingleFolderMode) + { + selected_folder = mSingleFolderPanelInventory->getSingleFolderRoot(); + } + else + { + LLFolderView* root = getActivePanel()->getRootFolder(); + std::set selection_set = root->getSelectionList(); + if (selection_set.size() == 1) + { + LLFolderViewItem* current_item = *selection_set.begin(); + if (current_item) + { + const LLUUID& id = static_cast(current_item->getViewModelItem())->getUUID(); + if(gInventory.getCategory(id) != NULL) + { + new_root_folder = id; + } + else + { + const LLViewerInventoryItem* selected_item = gInventory.getItem(id); + if (selected_item && selected_item->getParentUUID().notNull()) + { + new_root_folder = selected_item->getParentUUID(); + selected_folder = id; + } + } + } + } + } + + toggleViewMode(); + + if (mSingleFolderMode && new_root_folder.notNull()) + { + setSingleFolderViewRoot(new_root_folder, true); + if(selected_folder.notNull()) + { + getActivePanel()->setSelection(selected_folder, TAKE_FOCUS_YES); + } + } + else + { + if(selected_folder.notNull()) + { + selectAllItemsPanel(); + getActivePanel()->setSelection(selected_folder, TAKE_FOCUS_YES); + } + } } void LLPanelMainInventory::onUpFolderClicked() -- cgit v1.2.3 From cb66156a72ad02ce937763a4439de32d05fc10d5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 16 Mar 2023 21:45:41 +0200 Subject: SL-19105 Fix menu's opening position --- indra/newview/llpanelmaininventory.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index f8c1fcb5f5..9fab6e4d2e 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1457,8 +1457,7 @@ void LLPanelMainInventory::showActionMenu(LLMenuGL* menu, std::string spawning_v LLView* spawning_view = getChild (spawning_view_name); S32 menu_x, menu_y; //show menu in co-ordinates of panel - spawning_view->localPointToOtherView(0, spawning_view->getRect().getHeight(), &menu_x, &menu_y, this); - menu_y += menu->getRect().getHeight(); + spawning_view->localPointToOtherView(0, 0, &menu_x, &menu_y, this); LLMenuGL::showPopup(this, menu, menu_x, menu_y); } } -- cgit v1.2.3 From 1eab3247111e66a3b81153173d1624a5c1c9fb72 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 21 Mar 2023 17:47:26 +0200 Subject: SL-19379 WIP Gallery view Inventory: first pass --- indra/newview/llpanelmaininventory.cpp | 157 ++++++++++++++++++++++++++++----- 1 file changed, 133 insertions(+), 24 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 9fab6e4d2e..a867077ab0 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -37,6 +37,7 @@ #include "llfilepicker.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" +#include "llinventorygallery.h" #include "llinventorymodelbackgroundfetch.h" #include "llfiltereditor.h" #include "llfloatersidepanelcontainer.h" @@ -115,7 +116,9 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mNeedUploadCost(true), mMenuViewDefault(NULL), mSingleFolderMode(false), - mFolderRootChangedConnection() + mViewMode(VIEW_LIST), + mListViewRootUpdatedConnection(), + mGalleryRootUpdatedConnection() { // Menu Callbacks (non contex menus) mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelMainInventory::doToSelected, this, _2)); @@ -242,9 +245,12 @@ BOOL LLPanelMainInventory::postBuild() mViewMenuButton = getChild("view_btn"); mSingleFolderPanelInventory = getChild("single_folder_inv"); - mFolderRootChangedConnection = mSingleFolderPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); + mListViewRootUpdatedConnection = mSingleFolderPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); mSingleFolderPanelInventory->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mSingleFolderPanelInventory, _1, _2)); + mInventoryGalleryPanel = getChild("gallery_view_inv"); + mGalleryRootUpdatedConnection = mInventoryGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); + initListCommandsHandlers(); const std::string texture_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost()); @@ -322,9 +328,13 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) mMenuAddHandle.markDead(); } - if (mFolderRootChangedConnection.connected()) + if (mListViewRootUpdatedConnection.connected()) + { + mListViewRootUpdatedConnection.disconnect(); + } + if (mGalleryRootUpdatedConnection.connected()) { - mFolderRootChangedConnection.disconnect(); + mGalleryRootUpdatedConnection.disconnect(); } } @@ -635,10 +645,18 @@ void LLPanelMainInventory::onClearSearch() void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) { + if(mSingleFolderMode && isGalleryViewMode()) + { + mFilterSubString = search_string; + mInventoryGalleryPanel->setFilterSubString(mFilterSubString); + return; + } + if (search_string == "") { onClearSearch(); } + if (!mActivePanel) { return; @@ -863,8 +881,9 @@ void LLPanelMainInventory::updateItemcountText() { LLInventoryModel::cat_array_t *cats; LLInventoryModel::item_array_t *items; - gInventory.getDirectDescendentsOf(mSingleFolderPanelInventory->getSingleFolderRoot(), cats, items); - + + gInventory.getDirectDescendentsOf(getCurrentSFVRoot(), cats, items); + string_args["[ITEM_COUNT]"] = llformat("%d", items->size()); string_args["[CATEGORY_COUNT]"] = llformat("%d", cats->size()); text = getString("ItemcountCompleted", string_args); @@ -1334,7 +1353,8 @@ void LLPanelMainInventory::toggleViewMode() mSingleFolderMode = !mSingleFolderMode; getChild("default_inventory_panel")->setVisible(!mSingleFolderMode); - getChild("single_folder_inventory")->setVisible(mSingleFolderMode); + getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); + getChild("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode()); getChild("nav_buttons")->setVisible(mSingleFolderMode); getChild("view_mode_btn")->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); @@ -1362,7 +1382,10 @@ void LLPanelMainInventory::onViewModeClick() LLUUID new_root_folder; if(mSingleFolderMode) { - selected_folder = mSingleFolderPanelInventory->getSingleFolderRoot(); + if(isListViewMode()) + { + selected_folder = mSingleFolderPanelInventory->getSingleFolderRoot(); + } } else { @@ -1413,33 +1436,57 @@ void LLPanelMainInventory::onViewModeClick() void LLPanelMainInventory::onUpFolderClicked() { - const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); + const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot()); if (cat) { if (cat->getParentUUID().notNull()) { - mSingleFolderPanelInventory->changeFolderRoot(cat->getParentUUID()); + if(isListViewMode()) + { + mSingleFolderPanelInventory->changeFolderRoot(cat->getParentUUID()); + } + if(isGalleryViewMode()) + { + mInventoryGalleryPanel->setRootFolder(cat->getParentUUID()); + } } } } void LLPanelMainInventory::onBackFolderClicked() { - mSingleFolderPanelInventory->onBackwardFolder(); + if(isListViewMode()) + { + mSingleFolderPanelInventory->onBackwardFolder(); + } + if(isGalleryViewMode()) + { + mInventoryGalleryPanel->onBackwardFolder(); + } } void LLPanelMainInventory::onForwardFolderClicked() { - mSingleFolderPanelInventory->onForwardFolder(); + if(isListViewMode()) + { + mSingleFolderPanelInventory->onForwardFolder(); + } + if(isGalleryViewMode()) + { + mInventoryGalleryPanel->onForwardFolder(); + } } void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool clear_nav_history) { - mSingleFolderPanelInventory->changeFolderRoot(folder_id); - if(clear_nav_history) + if(isListViewMode()) { - mSingleFolderPanelInventory->clearNavigationHistory(); - updateNavButtons(); + mSingleFolderPanelInventory->changeFolderRoot(folder_id); + if(clear_nav_history) + { + mSingleFolderPanelInventory->clearNavigationHistory(); + updateNavButtons(); + } } } @@ -1638,7 +1685,16 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) if (command_name == "include_links") { mActivePanel->getFilter().toggleSearchVisibilityLinks(); - } + } + + if (command_name == "list_view") + { + setViewMode(VIEW_LIST); + } + if (command_name == "gallery_view") + { + setViewMode(VIEW_GALLERY); + } } void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility ) @@ -1821,11 +1877,11 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) if (command_name == "list_view") { - return true; + return isListViewMode(); } if (command_name == "gallery_view") { - return false; + return isGalleryViewMode(); } if (command_name == "combination_view") { @@ -1862,7 +1918,7 @@ void LLPanelMainInventory::updateTitle() { if(mSingleFolderMode) { - const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); + const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot()); if (cat) { inventory_floater->setTitle(cat->getName()); @@ -1883,10 +1939,18 @@ void LLPanelMainInventory::updateTitle() void LLPanelMainInventory::updateNavButtons() { - getChild("back_btn")->setEnabled(mSingleFolderPanelInventory->isBackwardAvailable()); - getChild("forward_btn")->setEnabled(mSingleFolderPanelInventory->isForwardAvailable()); - - const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); + if(isListViewMode()) + { + getChild("back_btn")->setEnabled(mSingleFolderPanelInventory->isBackwardAvailable()); + getChild("forward_btn")->setEnabled(mSingleFolderPanelInventory->isForwardAvailable()); + } + if(isGalleryViewMode()) + { + getChild("back_btn")->setEnabled(mInventoryGalleryPanel->isBackwardAvailable()); + getChild("forward_btn")->setEnabled(mInventoryGalleryPanel->isForwardAvailable()); + } + + const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot()); bool up_enabled = (cat && cat->getParentUUID().notNull()); getChild("up_btn")->setEnabled(up_enabled); } @@ -1900,5 +1964,50 @@ LLSidepanelInventory* LLPanelMainInventory::getParentSidepanelInventory() } return NULL; } + +void LLPanelMainInventory::setViewMode(EViewModeType mode) +{ + if(mode != mViewMode) + { + LLUUID cur_root = getCurrentSFVRoot(); + mViewMode = mode; + + getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); + getChild("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode()); + + if(isListViewMode()) + { + mSingleFolderPanelInventory->changeFolderRoot(cur_root); + mSingleFolderPanelInventory->setNavForwardList(mInventoryGalleryPanel->getNavForwardList()); + mSingleFolderPanelInventory->setNavBackwardList(mInventoryGalleryPanel->getNavBackwardList()); + } + if(isGalleryViewMode()) + { + mInventoryGalleryPanel->setRootFolder(cur_root); + mInventoryGalleryPanel->setNavForwardList(mSingleFolderPanelInventory->getNavForwardList()); + mInventoryGalleryPanel->setNavBackwardList(mSingleFolderPanelInventory->getNavBackwardList()); + } + updateNavButtons(); + + if((isListViewMode() && (mActivePanel->getFilterSubString() != mFilterSubString)) || + (isGalleryViewMode() && (mInventoryGalleryPanel->getFilterSubString() != mFilterSubString))) + { + onFilterEdit(mFilterSubString); + } + } +} + +LLUUID LLPanelMainInventory::getCurrentSFVRoot() +{ + if(isListViewMode()) + { + return mSingleFolderPanelInventory->getSingleFolderRoot(); + } + if(isGalleryViewMode()) + { + return mInventoryGalleryPanel->getRootFolder(); + } + return LLUUID::null; +} // List Commands // //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 19e9b5d488e5478d6c5ecbb85000e6da3e6124bb Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 21 Mar 2023 19:19:58 +0200 Subject: SL-19379 build fix --- indra/newview/llpanelmaininventory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a867077ab0..2816a2dc89 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -116,7 +116,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mNeedUploadCost(true), mMenuViewDefault(NULL), mSingleFolderMode(false), - mViewMode(VIEW_LIST), + mViewMode(MODE_LIST), mListViewRootUpdatedConnection(), mGalleryRootUpdatedConnection() { @@ -1689,11 +1689,11 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) if (command_name == "list_view") { - setViewMode(VIEW_LIST); + setViewMode(MODE_LIST); } if (command_name == "gallery_view") { - setViewMode(VIEW_GALLERY); + setViewMode(MODE_GALLERY); } } -- cgit v1.2.3 From dfbf9e6d96293b7f97553154d103883dede477b8 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 23 Mar 2023 11:58:17 +0200 Subject: SL-19379 WIP update Add menu for Gallery view --- indra/newview/llpanelmaininventory.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 2816a2dc89..e60ee20210 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -482,11 +482,18 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) reset_inventory_filter(); if(mSingleFolderMode) { - LLFolderViewItem* current_folder = getActivePanel()->getRootFolder(); - if (current_folder) + if(isListViewMode()) + { + LLFolderViewItem* current_folder = getActivePanel()->getRootFolder(); + if (current_folder) + { + LLFolderBridge* bridge = (LLFolderBridge*)current_folder->getViewModelItem(); + menu_create_inventory_item(getPanel(), bridge, userdata); + } + } + else if(isGalleryViewMode()) { - LLFolderBridge* bridge = (LLFolderBridge*)current_folder->getViewModelItem(); - menu_create_inventory_item(getPanel(), bridge, userdata); + menu_create_inventory_item(NULL, mInventoryGalleryPanel->getRootFolder(), userdata); } } else -- cgit v1.2.3 From 6172945775790757af827dfb88251875b0dd446f Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 23 Mar 2023 13:56:42 +0200 Subject: SL-19391 FIXED SFV floater title displays unlocalised name for system folders --- indra/newview/llpanelmaininventory.cpp | 55 +++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 18 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e60ee20210..23a32df2cc 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -53,6 +53,7 @@ #include "llspinctrl.h" #include "lltoggleablemenu.h" #include "lltooldraganddrop.h" +#include "lltrans.h" #include "llviewermenu.h" #include "llviewertexturelist.h" #include "llsidepanelinventory.h" @@ -763,11 +764,7 @@ void LLPanelMainInventory::onFilterSelected() finder->changeFilter(&filter); if (mSingleFolderMode) { - const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); - if (cat) - { - finder->setTitle(cat->getName()); - } + finder->setTitle(getLocalizedRootName()); } } if (filter.isActive()) @@ -934,11 +931,7 @@ void LLPanelMainInventory::toggleFindOptions() if (mSingleFolderMode) { - const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); - if (cat) - { - finder->setTitle(cat->getName()); - } + finder->setTitle(getLocalizedRootName()); } } else @@ -1925,15 +1918,11 @@ void LLPanelMainInventory::updateTitle() { if(mSingleFolderMode) { - const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot()); - if (cat) + inventory_floater->setTitle(getLocalizedRootName()); + LLFloaterInventoryFinder *finder = getFinder(); + if (finder) { - inventory_floater->setTitle(cat->getName()); - LLFloaterInventoryFinder *finder = getFinder(); - if (finder) - { - finder->setTitle(cat->getName()); - } + finder->setTitle(getLocalizedRootName()); } } else @@ -2004,6 +1993,36 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) } } +std::string LLPanelMainInventory::getLocalizedRootName() +{ + std::string localized_root_name; + if(mSingleFolderMode) + { + const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot()); + if (cat) + { + LLFolderType::EType preferred_type = cat->getPreferredType(); + + // Translation of Accessories folder in Library inventory folder + bool accessories = false; + if(getName() == "Accessories") + { + const LLUUID& parent_folder_id = cat->getParentUUID(); + accessories = (parent_folder_id == gInventory.getLibraryRootFolderID()); + } + + //"Accessories" inventory category has folder type FT_NONE. So, this folder + //can not be detected as protected with LLFolderType::lookupIsProtectedType + localized_root_name.assign(cat->getName()); + if (accessories || LLFolderType::lookupIsProtectedType(preferred_type)) + { + LLTrans::findString(localized_root_name, std::string("InvFolder ") + cat->getName(), LLSD()); + } + } + } + return localized_root_name; +} + LLUUID LLPanelMainInventory::getCurrentSFVRoot() { if(isListViewMode()) -- cgit v1.2.3 From 3605d3164d83b966c5c4a330713092d05e8e5698 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 24 Mar 2023 13:58:29 +0200 Subject: SL-19379 WIP show localized folder names in Gallery --- indra/newview/llpanelmaininventory.cpp | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 23a32df2cc..f430e44ec2 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1995,32 +1995,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) std::string LLPanelMainInventory::getLocalizedRootName() { - std::string localized_root_name; - if(mSingleFolderMode) - { - const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot()); - if (cat) - { - LLFolderType::EType preferred_type = cat->getPreferredType(); - - // Translation of Accessories folder in Library inventory folder - bool accessories = false; - if(getName() == "Accessories") - { - const LLUUID& parent_folder_id = cat->getParentUUID(); - accessories = (parent_folder_id == gInventory.getLibraryRootFolderID()); - } - - //"Accessories" inventory category has folder type FT_NONE. So, this folder - //can not be detected as protected with LLFolderType::lookupIsProtectedType - localized_root_name.assign(cat->getName()); - if (accessories || LLFolderType::lookupIsProtectedType(preferred_type)) - { - LLTrans::findString(localized_root_name, std::string("InvFolder ") + cat->getName(), LLSD()); - } - } - } - return localized_root_name; + return mSingleFolderMode ? get_localized_folder_name(getCurrentSFVRoot()) : ""; } LLUUID LLPanelMainInventory::getCurrentSFVRoot() -- cgit v1.2.3 From 9697ac1bece30bda6410a8dc33450b85a3358745 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 24 Mar 2023 16:22:57 +0200 Subject: SL-19335 update for switching in/out of Gallery view --- indra/newview/llpanelmaininventory.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index f430e44ec2..3679a22e5e 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1382,10 +1382,7 @@ void LLPanelMainInventory::onViewModeClick() LLUUID new_root_folder; if(mSingleFolderMode) { - if(isListViewMode()) - { - selected_folder = mSingleFolderPanelInventory->getSingleFolderRoot(); - } + selected_folder = getCurrentSFVRoot(); } else { @@ -1419,7 +1416,7 @@ void LLPanelMainInventory::onViewModeClick() if (mSingleFolderMode && new_root_folder.notNull()) { setSingleFolderViewRoot(new_root_folder, true); - if(selected_folder.notNull()) + if(selected_folder.notNull() && isListViewMode()) { getActivePanel()->setSelection(selected_folder, TAKE_FOCUS_YES); } @@ -1485,9 +1482,17 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool if(clear_nav_history) { mSingleFolderPanelInventory->clearNavigationHistory(); - updateNavButtons(); } } + else if(isGalleryViewMode()) + { + mInventoryGalleryPanel->setRootFolder(folder_id); + if(clear_nav_history) + { + mInventoryGalleryPanel->clearNavigationHistory(); + } + } + updateNavButtons(); } LLUUID LLPanelMainInventory::getSingleFolderViewRoot() -- cgit v1.2.3 From c10eed08189161bab67cfc296b1891a989d5748d Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 29 Mar 2023 18:02:04 +0300 Subject: SL-19379 WIP allow change search type for Gallery --- indra/newview/llpanelmaininventory.cpp | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 3679a22e5e..ffa92a3c11 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -566,25 +566,47 @@ void LLPanelMainInventory::onSelectSearchType() std::string new_type = mSearchTypeCombo->getValue(); if (new_type == "search_by_name") { - getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_NAME); + setSearchType(LLInventoryFilter::SEARCHTYPE_NAME); } if (new_type == "search_by_creator") { - getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_CREATOR); + setSearchType(LLInventoryFilter::SEARCHTYPE_CREATOR); } if (new_type == "search_by_description") { - getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_DESCRIPTION); + setSearchType(LLInventoryFilter::SEARCHTYPE_DESCRIPTION); } if (new_type == "search_by_UUID") { - getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_UUID); + setSearchType(LLInventoryFilter::SEARCHTYPE_UUID); } } +void LLPanelMainInventory::setSearchType(LLInventoryFilter::ESearchType type) +{ + if(mSingleFolderMode && isGalleryViewMode()) + { + mInventoryGalleryPanel->setSearchType(type); + } + else + { + getActivePanel()->setSearchType(type); + } +} + void LLPanelMainInventory::updateSearchTypeCombo() { - LLInventoryFilter::ESearchType search_type = getActivePanel()->getSearchType(); + LLInventoryFilter::ESearchType search_type(LLInventoryFilter::SEARCHTYPE_NAME); + + if(mSingleFolderMode && isGalleryViewMode()) + { + search_type = mInventoryGalleryPanel->getSearchType(); + } + else + { + search_type = getActivePanel()->getSearchType(); + } + switch(search_type) { case LLInventoryFilter::SEARCHTYPE_CREATOR: -- cgit v1.2.3 From c15ee792a7248cf141abb3ae6a26b33a5aca1ed7 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 30 Mar 2023 15:04:49 +0300 Subject: SL-19379 WIP allow hide link items in search result --- indra/newview/llpanelmaininventory.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') 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") -- cgit v1.2.3 From ae3e3662159ca26db5b2efe36d91a9ccdfcec256 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 30 Mar 2023 21:39:43 +0300 Subject: SL-19379 WIP update gear menu with Gallery items --- indra/newview/llpanelmaininventory.cpp | 163 ++++++++++++++++++++++++++------- 1 file changed, 130 insertions(+), 33 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index cc2c17d17d..e55d1f19f4 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -130,7 +130,6 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mCommitCallbackRegistrar.add("Inventory.ShowFilters", boost::bind(&LLPanelMainInventory::toggleFindOptions, this)); mCommitCallbackRegistrar.add("Inventory.ResetFilters", boost::bind(&LLPanelMainInventory::resetFilters, this)); mCommitCallbackRegistrar.add("Inventory.SetSortBy", boost::bind(&LLPanelMainInventory::setSortBy, this, _2)); - mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this)); mEnableCallbackRegistrar.add("Inventory.EnvironmentEnabled", [](LLUICtrl *, const LLSD &) { return LLPanelMainInventory::hasSettingsInventory(); }); @@ -416,14 +415,15 @@ S32 get_instance_num() return instance_num; } -void LLPanelMainInventory::newWindow() +LLFloaterSidePanelContainer* LLPanelMainInventory::newWindow() { S32 instance_num = get_instance_num(); if (!gAgentCamera.cameraMouselook()) { - LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); + return LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); } + return NULL; } //static @@ -527,6 +527,17 @@ void LLPanelMainInventory::resetAllItemsFilters() setFilterTextFromFilter(); } +void LLPanelMainInventory::findLinks(const LLUUID& item_id, const std::string& item_name) +{ + mFilterSubString = item_name; + + LLInventoryFilter &filter = mActivePanel->getFilter(); + filter.setFindAllLinksMode(item_name, item_id); + + mFilterEditor->setText(item_name); + mFilterEditor->setFocus(TRUE); +} + void LLPanelMainInventory::setSortBy(const LLSD& userdata) { U32 sort_order_mask = getActivePanel()->getSortOrder(); @@ -1556,13 +1567,22 @@ void LLPanelMainInventory::onClipboardAction(const LLSD& userdata) void LLPanelMainInventory::saveTexture(const LLSD& userdata) { - LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); - if (!current_item) - { - return; - } - - const LLUUID& item_id = static_cast(current_item->getViewModelItem())->getUUID(); + LLUUID item_id; + if(mSingleFolderMode && isGalleryViewMode()) + { + item_id = mInventoryGalleryPanel->getSelectedItemID(); + if (item_id.isNull()) return; + } + else + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + item_id = static_cast(current_item->getViewModelItem())->getUUID(); + } + LLPreviewTexture* preview_texture = LLFloaterReg::showTypedInstance("preview_texture", LLSD(item_id), TAKE_FOCUS_YES); if (preview_texture) { @@ -1646,35 +1666,69 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) } if (command_name == "find_original") { + if(mSingleFolderMode && isGalleryViewMode()) + { + LLInventoryObject *obj = gInventory.getObject(mInventoryGalleryPanel->getSelectedItemID()); + if (obj && obj->getIsLinkType()) + { + show_item_original(obj->getUUID()); + } + } + else + { LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { return; } static_cast(current_item->getViewModelItem())->performAction(getActivePanel()->getModel(), "goto"); + } } if (command_name == "find_links") { - LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); - if (!current_item) - { - return; - } - const LLUUID& item_id = static_cast(current_item->getViewModelItem())->getUUID(); - const std::string &item_name = current_item->getViewModelItem()->getName(); - mFilterSubString = item_name; - - LLInventoryFilter &filter = mActivePanel->getFilter(); - filter.setFindAllLinksMode(item_name, item_id); - - mFilterEditor->setText(item_name); - mFilterEditor->setFocus(TRUE); + if(mSingleFolderMode && isGalleryViewMode()) + { + LLFloaterSidePanelContainer* inventory_container = newWindow(); + if (inventory_container) + { + LLSidepanelInventory* sidepanel_inventory = dynamic_cast(inventory_container->findChild("main_panel", true)); + if (sidepanel_inventory) + { + LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); + if (main_inventory) + { + LLInventoryObject *obj = gInventory.getObject(mInventoryGalleryPanel->getSelectedItemID()); + if (obj) + { + main_inventory->findLinks(obj->getUUID(), obj->getName()); + } + } + } + } + } + else + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + const LLUUID& item_id = static_cast(current_item->getViewModelItem())->getUUID(); + const std::string &item_name = current_item->getViewModelItem()->getName(); + findLinks(item_id, item_name); + } } if (command_name == "replace_links") { - LLSD params; + LLSD params; + if(mSingleFolderMode && isGalleryViewMode()) + { + params = LLSD(mInventoryGalleryPanel->getSelectedItemID()); + } + else + { LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); if (current_item) { @@ -1689,6 +1743,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) } } } + } LLFloaterReg::showInstance("linkreplace", params); } @@ -1733,6 +1788,19 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) } } + if (command_name == "share") + { + if(mSingleFolderMode && isGalleryViewMode()) + { + std::set uuids{mInventoryGalleryPanel->getSelectedItemID()}; + LLAvatarActions::shareWithAvatars(uuids, gFloaterView->getParentFloater(this)); + } + else + { + LLAvatarActions::shareWithAvatars(this); + } + } + if (command_name == "list_view") { setViewMode(MODE_LIST); @@ -1758,17 +1826,26 @@ void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility ) bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata) { - LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); - if (current_item) - { - LLViewerInventoryItem *inv_item = dynamic_cast(static_cast(current_item->getViewModelItem())->getInventoryObject()); + LLViewerInventoryItem *inv_item = NULL; + if(mSingleFolderMode && isGalleryViewMode()) + { + inv_item = gInventory.getItem(mInventoryGalleryPanel->getSelectedItemID()); + } + else + { + LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (current_item) + { + inv_item = dynamic_cast(static_cast(current_item->getViewModelItem())->getInventoryObject()); + } + } if(inv_item) { bool can_save = inv_item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED); - LLInventoryType::EType curr_type = static_cast(current_item->getViewModelItem())->getInventoryType(); + LLInventoryType::EType curr_type = inv_item->getInventoryType(); return can_save && (curr_type == LLInventoryType::IT_TEXTURE || curr_type == LLInventoryType::IT_SNAPSHOT); } - } + return false; } @@ -1799,9 +1876,16 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) } if (command_name == "find_original") { + LLUUID item_id; + if(mSingleFolderMode && isGalleryViewMode()) + { + item_id = mInventoryGalleryPanel->getSelectedItemID(); + } + else{ LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) return FALSE; - const LLUUID& item_id = static_cast(current_item->getViewModelItem())->getUUID(); + item_id = static_cast(current_item->getViewModelItem())->getUUID(); + } const LLViewerInventoryItem *item = gInventory.getItem(item_id); if (item && item->getIsLinkType() && !item->getIsBrokenLink()) { @@ -1812,12 +1896,19 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) if (command_name == "find_links") { + LLUUID item_id; + if(mSingleFolderMode && isGalleryViewMode()) + { + item_id = mInventoryGalleryPanel->getSelectedItemID(); + } + else{ LLFolderView* root = getActivePanel()->getRootFolder(); std::set selection_set = root->getSelectionList(); if (selection_set.size() != 1) return FALSE; LLFolderViewItem* current_item = root->getCurSelectedItem(); if (!current_item) return FALSE; - const LLUUID& item_id = static_cast(current_item->getViewModelItem())->getUUID(); + item_id = static_cast(current_item->getViewModelItem())->getUUID(); + } const LLInventoryObject *obj = gInventory.getObject(item_id); if (obj && !obj->getIsLinkType() && LLAssetType::lookupCanLink(obj->getType())) { @@ -1841,10 +1932,16 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) if (command_name == "share") { + if(mSingleFolderMode && isGalleryViewMode()) + { + return can_share_item(mInventoryGalleryPanel->getSelectedItemID()); + } + else{ LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) return FALSE; LLSidepanelInventory* parent = LLFloaterSidePanelContainer::getPanel("inventory"); return parent ? parent->canShare() : FALSE; + } } if (command_name == "empty_trash") { -- cgit v1.2.3 From bc285ed41e86e685df07f4039c64c0402833b047 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 3 Apr 2023 21:34:37 +0300 Subject: SL-19521 Inventory filters floater should affect Inventory Gallery --- indra/newview/llpanelmaininventory.cpp | 96 ++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 38 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e55d1f19f4..383250e3ac 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -506,7 +506,7 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) void LLPanelMainInventory::resetFilters() { LLFloaterInventoryFinder *finder = getFinder(); - getActivePanel()->getFilter().resetDefault(); + getCurrentFilter().resetDefault(); if (finder) { finder->updateElementsFromFilter(); @@ -802,7 +802,7 @@ void LLPanelMainInventory::onFilterSelected() } updateSearchTypeCombo(); setFilterSubString(mFilterSubString); - LLInventoryFilter& filter = mActivePanel->getFilter(); + LLInventoryFilter& filter = getCurrentFilter(); LLFloaterInventoryFinder *finder = getFinder(); if (finder) { @@ -956,7 +956,7 @@ void LLPanelMainInventory::onFocusReceived() void LLPanelMainInventory::setFilterTextFromFilter() { - mFilterText = mActivePanel->getFilter().getFilterText(); + mFilterText = getCurrentFilter().getFilterText(); } void LLPanelMainInventory::toggleFindOptions() @@ -1210,10 +1210,21 @@ void LLFloaterInventoryFinder::draw() filter &= ~(0x1 << LLInventoryType::IT_CATEGORY); } - // update the panel, panel will update the filter - mPanelMainInventory->getPanel()->setShowFolderState(getCheckShowEmpty() ? - LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mPanelMainInventory->getPanel()->setFilterTypes(filter); + + bool is_gallery = mPanelMainInventory->isSingleFolderMode() && mPanelMainInventory->isGalleryViewMode(); + if(is_gallery) + { + mPanelMainInventory->mInventoryGalleryPanel->getFilter().setShowFolderState(getCheckShowEmpty() ? + LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mPanelMainInventory->mInventoryGalleryPanel->getFilter().setFilterObjectTypes(filter); + } + else + { + // update the panel, panel will update the filter + mPanelMainInventory->getPanel()->setShowFolderState(getCheckShowEmpty() ? + LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mPanelMainInventory->getPanel()->setFilterTypes(filter); + } if (getCheckSinceLogoff()) { @@ -1235,10 +1246,20 @@ void LLFloaterInventoryFinder::draw() } hours += days * 24; - mPanelMainInventory->getPanel()->setHoursAgo(hours); - mPanelMainInventory->getPanel()->setSinceLogoff(getCheckSinceLogoff()); + mPanelMainInventory->setFilterTextFromFilter(); - mPanelMainInventory->getPanel()->setDateSearchDirection(getDateSearchDirection()); + if(is_gallery) + { + mPanelMainInventory->mInventoryGalleryPanel->getFilter().setHoursAgo(hours); + mPanelMainInventory->mInventoryGalleryPanel->getFilter().setDateRangeLastLogoff(getCheckSinceLogoff()); + mPanelMainInventory->mInventoryGalleryPanel->getFilter().setDateSearchDirection(getDateSearchDirection()); + } + else + { + mPanelMainInventory->getPanel()->setHoursAgo(hours); + mPanelMainInventory->getPanel()->setSinceLogoff(getCheckSinceLogoff()); + mPanelMainInventory->getPanel()->setDateSearchDirection(getDateSearchDirection()); + } LLPanel::draw(); } @@ -1250,15 +1271,15 @@ void LLFloaterInventoryFinder::onCreatorSelfFilterCommit() if(show_creator_self && show_creator_other) { - mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); + mPanelMainInventory->getCurrentFilter().setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); } else if(show_creator_self) { - mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF); + mPanelMainInventory->getCurrentFilter().setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF); } else if(!show_creator_self || !show_creator_other) { - mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS); + mPanelMainInventory->getCurrentFilter().setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS); mCreatorOthers->set(TRUE); } } @@ -1270,15 +1291,15 @@ void LLFloaterInventoryFinder::onCreatorOtherFilterCommit() if(show_creator_self && show_creator_other) { - mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); + mPanelMainInventory->getCurrentFilter().setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); } else if(show_creator_other) { - mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS); + mPanelMainInventory->getCurrentFilter().setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS); } else if(!show_creator_other || !show_creator_self) { - mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF); + mPanelMainInventory->getCurrentFilter().setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF); mCreatorSelf->set(TRUE); } } @@ -1763,29 +1784,22 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) if (command_name == "toggle_search_outfits") { - mActivePanel->getFilter().toggleSearchVisibilityOutfits(); + getCurrentFilter().toggleSearchVisibilityOutfits(); } if (command_name == "toggle_search_trash") { - mActivePanel->getFilter().toggleSearchVisibilityTrash(); + getCurrentFilter().toggleSearchVisibilityTrash(); } if (command_name == "toggle_search_library") { - mActivePanel->getFilter().toggleSearchVisibilityLibrary(); + getCurrentFilter().toggleSearchVisibilityLibrary(); } if (command_name == "include_links") { - if(mSingleFolderMode && isGalleryViewMode()) - { - mInventoryGalleryPanel->toggleSearchLinks(); - } - else - { - mActivePanel->getFilter().toggleSearchVisibilityLinks(); - } + getCurrentFilter().toggleSearchVisibilityLinks(); } if (command_name == "share") @@ -2000,29 +2014,22 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) if (command_name == "toggle_search_outfits") { - return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_OUTFITS) != 0; + return (getCurrentFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_OUTFITS) != 0; } if (command_name == "toggle_search_trash") { - return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_TRASH) != 0; + return (getCurrentFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_TRASH) != 0; } if (command_name == "toggle_search_library") { - return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LIBRARY) != 0; + return (getCurrentFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LIBRARY) != 0; } if (command_name == "include_links") { - if(mSingleFolderMode && isGalleryViewMode()) - { - return mInventoryGalleryPanel->getSearchLinks(); - } - else - { - return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LINKS) != 0; - } + return (getCurrentFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LINKS) != 0; } if (command_name == "list_view") @@ -2135,6 +2142,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) } updateNavButtons(); + onFilterSelected(); if((isListViewMode() && (mActivePanel->getFilterSubString() != mFilterSubString)) || (isGalleryViewMode() && (mInventoryGalleryPanel->getFilterSubString() != mFilterSubString))) { @@ -2160,5 +2168,17 @@ LLUUID LLPanelMainInventory::getCurrentSFVRoot() } return LLUUID::null; } + +LLInventoryFilter& LLPanelMainInventory::getCurrentFilter() +{ + if(mSingleFolderMode && isGalleryViewMode()) + { + return mInventoryGalleryPanel->getFilter(); + } + else + { + return mActivePanel->getFilter(); + } +} // List Commands // //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 7ccfbd7c285cc2ab0bbf569912f8e9e2d5c1df72 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 4 Apr 2023 15:14:02 +0300 Subject: SL-19379 Don't switch focus to other Inventory floater when creating an item in Gallery --- indra/newview/llpanelmaininventory.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 383250e3ac..79b41f8e5f 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2180,5 +2180,13 @@ LLInventoryFilter& LLPanelMainInventory::getCurrentFilter() return mActivePanel->getFilter(); } } + +void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id) +{ + if(mSingleFolderMode && isGalleryViewMode()) + { + mInventoryGalleryPanel->changeItemSelection(item_id); + } +} // List Commands // //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From cc39c1e852b1b8ad0e6dc2bb7907b8116c716c1d Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 6 Apr 2023 19:51:08 +0300 Subject: SL-19544 preparation for Combination view --- indra/newview/llpanelmaininventory.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 79b41f8e5f..7d7a92de81 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1421,6 +1421,7 @@ void LLPanelMainInventory::toggleViewMode() getChild("default_inventory_panel")->setVisible(!mSingleFolderMode); getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); getChild("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode()); + getChild("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode()); getChild("nav_buttons")->setVisible(mSingleFolderMode); getChild("view_mode_btn")->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); @@ -1823,6 +1824,10 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) { setViewMode(MODE_GALLERY); } + if (command_name == "combination_view") + { + setViewMode(MODE_COMBINATION); + } } void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility ) @@ -2042,7 +2047,7 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) } if (command_name == "combination_view") { - return false; + return isCombinationViewMode(); } return FALSE; @@ -2127,6 +2132,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); getChild("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode()); + getChild("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode()); if(isListViewMode()) { @@ -2166,6 +2172,11 @@ LLUUID LLPanelMainInventory::getCurrentSFVRoot() { return mInventoryGalleryPanel->getRootFolder(); } + if(isCombinationViewMode()) + { + //todo: should get actual Combination view root + return mSingleFolderPanelInventory->getSingleFolderRoot(); + } return LLUUID::null; } -- cgit v1.2.3 From b3beabec8660602a891c94f4afb8c63a2b31e62f Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 6 Apr 2023 20:12:56 +0300 Subject: SL-19550 Add a shop menu item to the Inventory menu --- indra/newview/llpanelmaininventory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 7d7a92de81..5535d64d27 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -60,6 +60,7 @@ #include "llfolderview.h" #include "llradiogroup.h" #include "llenvironment.h" +#include "llweb.h" const std::string FILTERS_FILENAME("filters.xml"); @@ -1815,7 +1816,10 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) LLAvatarActions::shareWithAvatars(this); } } - + if (command_name == "shop") + { + LLWeb::loadURL(gSavedSettings.getString("MarketplaceURL")); + } if (command_name == "list_view") { setViewMode(MODE_LIST); -- cgit v1.2.3 From d5a949d97a67c8b9e551fc4b22d4c901eaf1d91a Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 7 Apr 2023 15:13:47 +0300 Subject: SL-19544 WIP Combination view first pass --- indra/newview/llpanelmaininventory.cpp | 90 +++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5535d64d27..e5c0e4cf9c 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -252,6 +252,19 @@ BOOL LLPanelMainInventory::postBuild() mInventoryGalleryPanel = getChild("gallery_view_inv"); mGalleryRootUpdatedConnection = mInventoryGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); + mCombinationPanelInventory = getChild("comb_single_folder_inv"); + LLInventoryFilter& comb_inv_filter = mCombinationPanelInventory->getFilter(); + comb_inv_filter.setFilterThumbnails(LLInventoryFilter::FILTER_EXCLUDE_THUMBNAILS); + comb_inv_filter.markDefault(); + mCombinationPanelInventory->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mCombinationPanelInventory, _1, _2)); + mCombinationPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); + + mCombinationGalleryPanel = getChild("comb_gallery_view_inv"); + LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter(); + comb_gallery_filter.setFilterThumbnails(LLInventoryFilter::FILTER_ONLY_THUMBNAILS); + comb_gallery_filter.markDefault(); + mCombinationGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, true)); + initListCommandsHandlers(); const std::string texture_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost()); @@ -887,6 +900,7 @@ void LLPanelMainInventory::draw() } LLPanel::draw(); updateItemcountText(); + updateCombinationVisibility(); } void LLPanelMainInventory::updateItemcountText() @@ -1514,6 +1528,10 @@ void LLPanelMainInventory::onUpFolderClicked() { mInventoryGalleryPanel->setRootFolder(cat->getParentUUID()); } + if(isCombinationViewMode()) + { + mCombinationPanelInventory->changeFolderRoot(cat->getParentUUID()); + } } } } @@ -1528,6 +1546,10 @@ void LLPanelMainInventory::onBackFolderClicked() { mInventoryGalleryPanel->onBackwardFolder(); } + if(isCombinationViewMode()) + { + mCombinationPanelInventory->onBackwardFolder(); + } } void LLPanelMainInventory::onForwardFolderClicked() @@ -1540,6 +1562,10 @@ void LLPanelMainInventory::onForwardFolderClicked() { mInventoryGalleryPanel->onForwardFolder(); } + if(isCombinationViewMode()) + { + mCombinationPanelInventory->onForwardFolder(); + } } void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool clear_nav_history) @@ -2099,6 +2125,26 @@ void LLPanelMainInventory::updateTitle() updateNavButtons(); } +void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) +{ + if(gallery_clicked) + { + mCombinationPanelInventory->changeFolderRoot(mCombinationGalleryPanel->getRootFolder()); + } + else + { + mCombinationGalleryPanel->setRootFolder(mCombinationPanelInventory->getSingleFolderRoot()); + } + + updateTitle(); +} + +void LLPanelMainInventory::updateCombinationVisibility() +{ + getChild("comb_gallery_layout")->setVisible(mCombinationGalleryPanel->hasVisibleItems()); + getChild("border")->setVisible(mCombinationGalleryPanel->hasVisibleItems()); +} + void LLPanelMainInventory::updateNavButtons() { if(isListViewMode()) @@ -2111,6 +2157,11 @@ void LLPanelMainInventory::updateNavButtons() getChild("back_btn")->setEnabled(mInventoryGalleryPanel->isBackwardAvailable()); getChild("forward_btn")->setEnabled(mInventoryGalleryPanel->isForwardAvailable()); } + if(isCombinationViewMode()) + { + getChild("back_btn")->setEnabled(mCombinationPanelInventory->isBackwardAvailable()); + getChild("forward_btn")->setEnabled(mCombinationPanelInventory->isForwardAvailable()); + } const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot()); bool up_enabled = (cat && cat->getParentUUID().notNull()); @@ -2131,6 +2182,24 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) { if(mode != mViewMode) { + std::list forward_history; + std::list backward_history; + switch(mViewMode) + { + case MODE_LIST: + forward_history = mSingleFolderPanelInventory->getNavForwardList(); + backward_history = mSingleFolderPanelInventory->getNavBackwardList(); + break; + case MODE_GALLERY: + forward_history = mInventoryGalleryPanel->getNavForwardList(); + backward_history = mInventoryGalleryPanel->getNavBackwardList(); + break; + case MODE_COMBINATION: + forward_history = mCombinationPanelInventory->getNavForwardList(); + backward_history = mCombinationPanelInventory->getNavBackwardList(); + break; + } + LLUUID cur_root = getCurrentSFVRoot(); mViewMode = mode; @@ -2141,15 +2210,25 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) if(isListViewMode()) { mSingleFolderPanelInventory->changeFolderRoot(cur_root); - mSingleFolderPanelInventory->setNavForwardList(mInventoryGalleryPanel->getNavForwardList()); - mSingleFolderPanelInventory->setNavBackwardList(mInventoryGalleryPanel->getNavBackwardList()); + mSingleFolderPanelInventory->setNavForwardList(forward_history); + mSingleFolderPanelInventory->setNavBackwardList(backward_history); } if(isGalleryViewMode()) { mInventoryGalleryPanel->setRootFolder(cur_root); - mInventoryGalleryPanel->setNavForwardList(mSingleFolderPanelInventory->getNavForwardList()); - mInventoryGalleryPanel->setNavBackwardList(mSingleFolderPanelInventory->getNavBackwardList()); + mInventoryGalleryPanel->setNavForwardList(forward_history); + mInventoryGalleryPanel->setNavBackwardList(backward_history); } + if(isCombinationViewMode()) + { + mCombinationPanelInventory->changeFolderRoot(cur_root); + mCombinationGalleryPanel->setRootFolder(cur_root); + mCombinationPanelInventory->setNavForwardList(forward_history); + mCombinationPanelInventory->setNavBackwardList(backward_history); + mCombinationGalleryPanel->setNavForwardList(forward_history); + mCombinationGalleryPanel->setNavBackwardList(backward_history); + } + updateNavButtons(); onFilterSelected(); @@ -2178,8 +2257,7 @@ LLUUID LLPanelMainInventory::getCurrentSFVRoot() } if(isCombinationViewMode()) { - //todo: should get actual Combination view root - return mSingleFolderPanelInventory->getSingleFolderRoot(); + return mCombinationPanelInventory->getSingleFolderRoot(); } return LLUUID::null; } -- cgit v1.2.3 From 7df076b62682b7e9749bb402958a3ea6735be283 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 7 Apr 2023 18:02:22 +0300 Subject: SL-19544 WIP apply filter when adding an item to the Gallery --- indra/newview/llpanelmaininventory.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e5c0e4cf9c..4c80adbd46 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -506,9 +506,9 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) menu_create_inventory_item(getPanel(), bridge, userdata); } } - else if(isGalleryViewMode()) + else { - menu_create_inventory_item(NULL, mInventoryGalleryPanel->getRootFolder(), userdata); + menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata); } } else @@ -625,6 +625,11 @@ void LLPanelMainInventory::setSearchType(LLInventoryFilter::ESearchType type) { mInventoryGalleryPanel->setSearchType(type); } + if(mSingleFolderMode && isCombinationViewMode()) + { + mCombinationPanelInventory->setSearchType(type); + mCombinationGalleryPanel->setSearchType(type); + } else { getActivePanel()->setSearchType(type); @@ -639,6 +644,10 @@ void LLPanelMainInventory::updateSearchTypeCombo() { search_type = mInventoryGalleryPanel->getSearchType(); } + else if(mSingleFolderMode && isCombinationViewMode()) + { + search_type = mCombinationGalleryPanel->getSearchType(); + } else { search_type = getActivePanel()->getSearchType(); @@ -2280,6 +2289,17 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id) { mInventoryGalleryPanel->changeItemSelection(item_id); } + else if(mSingleFolderMode && isCombinationViewMode()) + { + if(mCombinationGalleryPanel->getFilter().checkAgainstFilterThumbnails(item_id)) + { + mCombinationGalleryPanel->changeItemSelection(item_id); + } + else + { + mCombinationPanelInventory->setSelection(item_id, false); + } + } } // List Commands // //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From af30c8c95b81e99c76bd5e08dcaab4c31dfdcac1 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 Apr 2023 21:20:30 +0300 Subject: SL-19533 Don't try to restart fetchexcessively No real point restarting, but due to significant changes decided to keep this around and raise asserts instead of removing. --- indra/newview/llpanelmaininventory.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 4c80adbd46..3ffe1b3901 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -738,7 +738,11 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) return; } - LLInventoryModelBackgroundFetch::instance().start(); + if (!LLInventoryModelBackgroundFetch::instance().inventoryFetchStarted()) + { + llassert(false); // this should have been done on startup + LLInventoryModelBackgroundFetch::instance().start(); + } mFilterSubString = search_string; if (mActivePanel->getFilterSubString().empty() && mFilterSubString.empty()) @@ -835,9 +839,9 @@ void LLPanelMainInventory::onFilterSelected() finder->setTitle(getLocalizedRootName()); } } - if (filter.isActive()) + if (filter.isActive() && !LLInventoryModelBackgroundFetch::instance().inventoryFetchStarted()) { - // If our filter is active we may be the first thing requiring a fetch so we better start it here. + llassert(false); // this should have been done on startup LLInventoryModelBackgroundFetch::instance().start(); } setFilterTextFromFilter(); @@ -995,8 +999,12 @@ void LLPanelMainInventory::toggleFindOptions() LLFloater* parent_floater = gFloaterView->getParentFloater(this); if (parent_floater) parent_floater->addDependentFloater(mFinderHandle); - // start background fetch of folders - LLInventoryModelBackgroundFetch::instance().start(); + + if (!LLInventoryModelBackgroundFetch::instance().inventoryFetchStarted()) + { + llassert(false); // this should have been done on startup + LLInventoryModelBackgroundFetch::instance().start(); + } if (mSingleFolderMode) { -- cgit v1.2.3 From 6e5b94071b62113f2bd52dd6985498990926a9f6 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 11 Apr 2023 21:39:23 +0300 Subject: SL-19544 WIP combination view filtering; hidden items should be correctly removed when root is changed --- indra/newview/llpanelmaininventory.cpp | 42 ++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 3ffe1b3901..48b23c3957 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -727,6 +727,10 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) mInventoryGalleryPanel->setFilterSubString(mFilterSubString); return; } + if(mSingleFolderMode && isCombinationViewMode()) + { + mCombinationGalleryPanel->setFilterSubString(search_string); + } if (search_string == "") { @@ -816,7 +820,7 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) void LLPanelMainInventory::onFilterSelected() { // Find my index - mActivePanel = mSingleFolderMode ? getChild("single_folder_inv") : (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); + setActivePanel(); if (!mActivePanel) { @@ -1243,8 +1247,8 @@ void LLFloaterInventoryFinder::draw() } - bool is_gallery = mPanelMainInventory->isSingleFolderMode() && mPanelMainInventory->isGalleryViewMode(); - if(is_gallery) + bool is_sf_mode = mPanelMainInventory->isSingleFolderMode(); + if(is_sf_mode && mPanelMainInventory->isGalleryViewMode()) { mPanelMainInventory->mInventoryGalleryPanel->getFilter().setShowFolderState(getCheckShowEmpty() ? LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); @@ -1252,6 +1256,12 @@ void LLFloaterInventoryFinder::draw() } else { + if(is_sf_mode && mPanelMainInventory->isCombinationViewMode()) + { + mPanelMainInventory->mCombinationGalleryPanel->getFilter().setShowFolderState(getCheckShowEmpty() ? + LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mPanelMainInventory->mCombinationGalleryPanel->getFilter().setFilterObjectTypes(filter); + } // update the panel, panel will update the filter mPanelMainInventory->getPanel()->setShowFolderState(getCheckShowEmpty() ? LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); @@ -1280,7 +1290,7 @@ void LLFloaterInventoryFinder::draw() mPanelMainInventory->setFilterTextFromFilter(); - if(is_gallery) + if(is_sf_mode && mPanelMainInventory->isGalleryViewMode()) { mPanelMainInventory->mInventoryGalleryPanel->getFilter().setHoursAgo(hours); mPanelMainInventory->mInventoryGalleryPanel->getFilter().setDateRangeLastLogoff(getCheckSinceLogoff()); @@ -1288,6 +1298,12 @@ void LLFloaterInventoryFinder::draw() } else { + if(is_sf_mode && mPanelMainInventory->isCombinationViewMode()) + { + mPanelMainInventory->mCombinationGalleryPanel->getFilter().setHoursAgo(hours); + mPanelMainInventory->mCombinationGalleryPanel->getFilter().setDateRangeLastLogoff(getCheckSinceLogoff()); + mPanelMainInventory->mCombinationGalleryPanel->getFilter().setDateSearchDirection(getDateSearchDirection()); + } mPanelMainInventory->getPanel()->setHoursAgo(hours); mPanelMainInventory->getPanel()->setSinceLogoff(getCheckSinceLogoff()); mPanelMainInventory->getPanel()->setDateSearchDirection(getDateSearchDirection()); @@ -1446,6 +1462,22 @@ void LLPanelMainInventory::onAddButtonClick() } } +void LLPanelMainInventory::setActivePanel() +{ + if(mSingleFolderMode && isListViewMode()) + { + mActivePanel = getChild("single_folder_inv"); + } + else if(mSingleFolderMode && isCombinationViewMode()) + { + mActivePanel = getChild("comb_single_folder_inv"); + } + else + { + mActivePanel = (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); + } +} + void LLPanelMainInventory::toggleViewMode() { mSingleFolderMode = !mSingleFolderMode; @@ -1457,7 +1489,7 @@ void LLPanelMainInventory::toggleViewMode() getChild("nav_buttons")->setVisible(mSingleFolderMode); getChild("view_mode_btn")->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); - mActivePanel = mSingleFolderMode ? getChild("single_folder_inv") : (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); + setActivePanel(); updateTitle(); onFilterSelected(); -- cgit v1.2.3 From 842bc87941d4574fe1ce34186872e43ecef881c3 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 12 Apr 2023 12:56:56 +0300 Subject: SL-19544 WIP update combination gallery visibility after changing filter --- indra/newview/llpanelmaininventory.cpp | 50 ++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 48b23c3957..18f80d5d55 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -252,12 +252,12 @@ BOOL LLPanelMainInventory::postBuild() mInventoryGalleryPanel = getChild("gallery_view_inv"); mGalleryRootUpdatedConnection = mInventoryGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); - mCombinationPanelInventory = getChild("comb_single_folder_inv"); - LLInventoryFilter& comb_inv_filter = mCombinationPanelInventory->getFilter(); + mCombinationInventoryPanel = getChild("comb_single_folder_inv"); + LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); comb_inv_filter.setFilterThumbnails(LLInventoryFilter::FILTER_EXCLUDE_THUMBNAILS); comb_inv_filter.markDefault(); - mCombinationPanelInventory->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mCombinationPanelInventory, _1, _2)); - mCombinationPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); + mCombinationInventoryPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mCombinationInventoryPanel, _1, _2)); + mCombinationInventoryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); mCombinationGalleryPanel = getChild("comb_gallery_view_inv"); LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter(); @@ -627,7 +627,7 @@ void LLPanelMainInventory::setSearchType(LLInventoryFilter::ESearchType type) } if(mSingleFolderMode && isCombinationViewMode()) { - mCombinationPanelInventory->setSearchType(type); + mCombinationInventoryPanel->setSearchType(type); mCombinationGalleryPanel->setSearchType(type); } else @@ -1579,7 +1579,7 @@ void LLPanelMainInventory::onUpFolderClicked() } if(isCombinationViewMode()) { - mCombinationPanelInventory->changeFolderRoot(cat->getParentUUID()); + mCombinationInventoryPanel->changeFolderRoot(cat->getParentUUID()); } } } @@ -1597,7 +1597,7 @@ void LLPanelMainInventory::onBackFolderClicked() } if(isCombinationViewMode()) { - mCombinationPanelInventory->onBackwardFolder(); + mCombinationInventoryPanel->onBackwardFolder(); } } @@ -1613,7 +1613,7 @@ void LLPanelMainInventory::onForwardFolderClicked() } if(isCombinationViewMode()) { - mCombinationPanelInventory->onForwardFolder(); + mCombinationInventoryPanel->onForwardFolder(); } } @@ -2178,11 +2178,11 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) { if(gallery_clicked) { - mCombinationPanelInventory->changeFolderRoot(mCombinationGalleryPanel->getRootFolder()); + mCombinationInventoryPanel->changeFolderRoot(mCombinationGalleryPanel->getRootFolder()); } else { - mCombinationGalleryPanel->setRootFolder(mCombinationPanelInventory->getSingleFolderRoot()); + mCombinationGalleryPanel->setRootFolder(mCombinationInventoryPanel->getSingleFolderRoot()); } updateTitle(); @@ -2190,8 +2190,16 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) void LLPanelMainInventory::updateCombinationVisibility() { - getChild("comb_gallery_layout")->setVisible(mCombinationGalleryPanel->hasVisibleItems()); - getChild("border")->setVisible(mCombinationGalleryPanel->hasVisibleItems()); + if(mSingleFolderMode && isCombinationViewMode()) + { + bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); + getChild("comb_gallery_layout")->setVisible(!is_gallery_empty); + getChild("border")->setVisible(!is_gallery_empty); + if(is_gallery_empty) + { + mCombinationGalleryPanel->handleModifiedFilter(); + } + } } void LLPanelMainInventory::updateNavButtons() @@ -2208,8 +2216,8 @@ void LLPanelMainInventory::updateNavButtons() } if(isCombinationViewMode()) { - getChild("back_btn")->setEnabled(mCombinationPanelInventory->isBackwardAvailable()); - getChild("forward_btn")->setEnabled(mCombinationPanelInventory->isForwardAvailable()); + getChild("back_btn")->setEnabled(mCombinationInventoryPanel->isBackwardAvailable()); + getChild("forward_btn")->setEnabled(mCombinationInventoryPanel->isForwardAvailable()); } const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot()); @@ -2244,8 +2252,8 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) backward_history = mInventoryGalleryPanel->getNavBackwardList(); break; case MODE_COMBINATION: - forward_history = mCombinationPanelInventory->getNavForwardList(); - backward_history = mCombinationPanelInventory->getNavBackwardList(); + forward_history = mCombinationInventoryPanel->getNavForwardList(); + backward_history = mCombinationInventoryPanel->getNavBackwardList(); break; } @@ -2270,10 +2278,10 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) } if(isCombinationViewMode()) { - mCombinationPanelInventory->changeFolderRoot(cur_root); + mCombinationInventoryPanel->changeFolderRoot(cur_root); mCombinationGalleryPanel->setRootFolder(cur_root); - mCombinationPanelInventory->setNavForwardList(forward_history); - mCombinationPanelInventory->setNavBackwardList(backward_history); + mCombinationInventoryPanel->setNavForwardList(forward_history); + mCombinationInventoryPanel->setNavBackwardList(backward_history); mCombinationGalleryPanel->setNavForwardList(forward_history); mCombinationGalleryPanel->setNavBackwardList(backward_history); } @@ -2306,7 +2314,7 @@ LLUUID LLPanelMainInventory::getCurrentSFVRoot() } if(isCombinationViewMode()) { - return mCombinationPanelInventory->getSingleFolderRoot(); + return mCombinationInventoryPanel->getSingleFolderRoot(); } return LLUUID::null; } @@ -2337,7 +2345,7 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id) } else { - mCombinationPanelInventory->setSelection(item_id, false); + mCombinationInventoryPanel->setSelection(item_id, false); } } } -- cgit v1.2.3 From bdd4cb5963df9550eb8e9c0bca0eff0010b44b1e Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 12 Apr 2023 19:11:59 +0300 Subject: SL-19544 WIP show drag handler control --- indra/newview/llpanelmaininventory.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 18f80d5d55..dfcfc94cea 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2194,7 +2194,6 @@ void LLPanelMainInventory::updateCombinationVisibility() { bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); getChild("comb_gallery_layout")->setVisible(!is_gallery_empty); - getChild("border")->setVisible(!is_gallery_empty); if(is_gallery_empty) { mCombinationGalleryPanel->handleModifiedFilter(); -- cgit v1.2.3 From 37530c9d736d90ec29b97e3567346a02e2826f97 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 12 Apr 2023 21:11:36 +0300 Subject: SL-19544 WIP hide inventory pane in Combination view, if there is no visible items --- indra/newview/llpanelmaininventory.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index dfcfc94cea..62b7a38857 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1480,6 +1480,11 @@ void LLPanelMainInventory::setActivePanel() void LLPanelMainInventory::toggleViewMode() { + if(mSingleFolderMode && isCombinationViewMode()) + { + mCombinationInventoryPanel->getRootFolder()->setForceArrange(false); + } + mSingleFolderMode = !mSingleFolderMode; getChild("default_inventory_panel")->setVisible(!mSingleFolderMode); @@ -2193,11 +2198,17 @@ void LLPanelMainInventory::updateCombinationVisibility() if(mSingleFolderMode && isCombinationViewMode()) { bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); + bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty; getChild("comb_gallery_layout")->setVisible(!is_gallery_empty); + getChild("comb_inventory_layout")->setVisible(show_inv_pane); + mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane); + if(is_gallery_empty) { mCombinationGalleryPanel->handleModifiedFilter(); } + + getActivePanel()->getRootFolder(); } } @@ -2253,6 +2264,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) case MODE_COMBINATION: forward_history = mCombinationInventoryPanel->getNavForwardList(); backward_history = mCombinationInventoryPanel->getNavBackwardList(); + mCombinationInventoryPanel->getRootFolder()->setForceArrange(false); break; } -- cgit v1.2.3 From 5554686b9117901cddb3d36f237622442c1d7a8d Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 17 Apr 2023 13:22:27 +0300 Subject: SL-19544 WIP show item permissions after item name --- indra/newview/llpanelmaininventory.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 62b7a38857..f67b09d121 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1640,6 +1640,10 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool mInventoryGalleryPanel->clearNavigationHistory(); } } + else if(isCombinationViewMode()) + { + mCombinationInventoryPanel->changeFolderRoot(folder_id); + } updateNavButtons(); } -- cgit v1.2.3 From ce2aaab15912693d51383274dc1dfebb20c0b6a2 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 18 Apr 2023 21:27:25 +0300 Subject: SL-19604 FIXED Creating new folders and items in gallery or combination views does not highlight created item --- indra/newview/llpanelmaininventory.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index f67b09d121..9d1e861344 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -497,7 +497,7 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) reset_inventory_filter(); if(mSingleFolderMode) { - if(isListViewMode()) + if(isListViewMode() || isCombinationViewMode()) { LLFolderViewItem* current_folder = getActivePanel()->getRootFolder(); if (current_folder) @@ -508,7 +508,12 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) } else { - menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata); + std::function callback_cat_created = [this](const LLUUID &new_category_id) + { + gInventory.notifyObservers(); + setGallerySelection(new_category_id); + }; + menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created); } } else @@ -2350,13 +2355,13 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id) { if(mSingleFolderMode && isGalleryViewMode()) { - mInventoryGalleryPanel->changeItemSelection(item_id); + mInventoryGalleryPanel->changeItemSelection(item_id, true); } else if(mSingleFolderMode && isCombinationViewMode()) { if(mCombinationGalleryPanel->getFilter().checkAgainstFilterThumbnails(item_id)) { - mCombinationGalleryPanel->changeItemSelection(item_id); + mCombinationGalleryPanel->changeItemSelection(item_id, true); } else { -- cgit v1.2.3 From 1e4ebffa0c801b41990ab38c85ef95eb6f948cd5 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 19 Apr 2023 17:09:39 +0300 Subject: SL-19604 show layout panel before creating new item in combination mode, if there are no items in inventory panel --- indra/newview/llpanelmaininventory.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 9d1e861344..d8845a7d94 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -118,6 +118,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mNeedUploadCost(true), mMenuViewDefault(NULL), mSingleFolderMode(false), + mForceShowInvLayout(false), mViewMode(MODE_LIST), mListViewRootUpdatedConnection(), mGalleryRootUpdatedConnection() @@ -502,6 +503,13 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) LLFolderViewItem* current_folder = getActivePanel()->getRootFolder(); if (current_folder) { + if(isCombinationViewMode()) + { + //show layout and inventory panel before adding the item + //to avoid wrong position of the 'renamer' + mForceShowInvLayout = true; + } + LLFolderBridge* bridge = (LLFolderBridge*)current_folder->getViewModelItem(); menu_create_inventory_item(getPanel(), bridge, userdata); } @@ -2198,7 +2206,7 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) { mCombinationGalleryPanel->setRootFolder(mCombinationInventoryPanel->getSingleFolderRoot()); } - + mForceShowInvLayout = false; updateTitle(); } @@ -2207,11 +2215,14 @@ void LLPanelMainInventory::updateCombinationVisibility() if(mSingleFolderMode && isCombinationViewMode()) { bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); - bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty; + bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout; getChild("comb_gallery_layout")->setVisible(!is_gallery_empty); getChild("comb_inventory_layout")->setVisible(show_inv_pane); mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane); - + if(mCombinationInventoryPanel->hasVisibleItems()) + { + mForceShowInvLayout = false; + } if(is_gallery_empty) { mCombinationGalleryPanel->handleModifiedFilter(); -- cgit v1.2.3 From 5527c65064d12d3916d15d8694fd1abb85e37f62 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 20 Apr 2023 14:56:57 +0300 Subject: SL-19105 set Combination view as default --- indra/newview/llpanelmaininventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index d8845a7d94..ee1801b9f3 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -119,7 +119,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mMenuViewDefault(NULL), mSingleFolderMode(false), mForceShowInvLayout(false), - mViewMode(MODE_LIST), + mViewMode(MODE_COMBINATION), mListViewRootUpdatedConnection(), mGalleryRootUpdatedConnection() { -- cgit v1.2.3 From 0304357384850466ab75ba586ba665c566fa2793 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 21 Apr 2023 18:48:54 +0300 Subject: SL-19356 bring existing sfv floater to the top regardless of selected view mode --- indra/newview/llpanelmaininventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index ee1801b9f3..98099dd407 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -455,7 +455,7 @@ void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_sele { LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); if (main_inventory && main_inventory->isSingleFolderMode() - && (main_inventory->getSingleFolderViewRoot() == folder_id)) + && (main_inventory->getCurrentSFVRoot() == folder_id)) { main_inventory->setFocus(true); if(item_to_select.notNull()) -- cgit v1.2.3 From 0091fa0cbaba034da09d42d49f68c63f2cc7df14 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 26 Apr 2023 03:53:05 +0300 Subject: SL-19583 Uniform risizing for combination inventory view --- indra/newview/llpanelmaininventory.cpp | 47 ++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 98099dd407..7cd6d7cb82 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -266,6 +266,8 @@ BOOL LLPanelMainInventory::postBuild() comb_gallery_filter.markDefault(); mCombinationGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, true)); + mCombinationScroller = getChild("combination_scroller"); + initListCommandsHandlers(); const std::string texture_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost()); @@ -928,6 +930,7 @@ void LLPanelMainInventory::draw() mActivePanel->setSortOrder(order); mResortActivePanel = false; } + LLPanel::draw(); updateItemcountText(); updateCombinationVisibility(); @@ -1503,7 +1506,7 @@ void LLPanelMainInventory::toggleViewMode() getChild("default_inventory_panel")->setVisible(!mSingleFolderMode); getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); getChild("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode()); - getChild("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode()); + getChild("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode()); getChild("nav_buttons")->setVisible(mSingleFolderMode); getChild("view_mode_btn")->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); @@ -2214,19 +2217,41 @@ void LLPanelMainInventory::updateCombinationVisibility() { if(mSingleFolderMode && isCombinationViewMode()) { - bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); - bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout; - getChild("comb_gallery_layout")->setVisible(!is_gallery_empty); - getChild("comb_inventory_layout")->setVisible(show_inv_pane); - mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane); - if(mCombinationInventoryPanel->hasVisibleItems()) + LLRect inner_rect = mCombinationInventoryPanel->getScrollableContainer()->getScrolledViewRect(); + LLRect inv_rect = mCombinationInventoryPanel->getRect(); + inv_rect.mBottom = 0; + inv_rect.mRight = inv_rect.mLeft + inner_rect.getWidth(); + if (!mCombinationGalleryPanel->hasVisibleItems() || mCombinationInventoryPanel->hasVisibleItems()) + { + inv_rect.mTop = inv_rect.mBottom + inner_rect.getHeight(); + } + else { - mForceShowInvLayout = false; + inv_rect.mTop = inv_rect.mBottom; } - if(is_gallery_empty) + + inner_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); + LLRect galery_rect = mCombinationGalleryPanel->getRect(); + galery_rect.mBottom = inv_rect.mTop; + if (mCombinationGalleryPanel->hasVisibleItems()) { - mCombinationGalleryPanel->handleModifiedFilter(); + mCombinationGalleryPanel->setVisible(true); + galery_rect.mTop = galery_rect.mBottom + inner_rect.getHeight(); } + else + { + mCombinationGalleryPanel->setVisible(false); + galery_rect.mTop = galery_rect.mBottom; + } + + LLRect scroller_rect = mCombinationScroller->getRect(); + scroller_rect.mBottom = 0; + scroller_rect.mTop = scroller_rect.mBottom + inv_rect.getHeight() + galery_rect.getHeight(); + scroller_rect.mRight = scroller_rect.mLeft + llmax(inv_rect.getWidth(), galery_rect.getWidth()); + + mCombinationScroller->setRect(scroller_rect); + mCombinationGalleryPanel->handleReshape(galery_rect, false); + mCombinationInventoryPanel->handleReshape(inv_rect, false); getActivePanel()->getRootFolder(); } @@ -2293,7 +2318,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); getChild("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode()); - getChild("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode()); + getChild("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode()); if(isListViewMode()) { -- cgit v1.2.3 From 30b87c11e92f1917aec95662f95a8e5a136c937e Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 27 Apr 2023 18:23:56 +0300 Subject: SL-19583 WIP fixed the issue with item selection and restored filter handling for gallery panel --- indra/newview/llpanelmaininventory.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 7cd6d7cb82..b9099bbebf 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2217,26 +2217,31 @@ void LLPanelMainInventory::updateCombinationVisibility() { if(mSingleFolderMode && isCombinationViewMode()) { - LLRect inner_rect = mCombinationInventoryPanel->getScrollableContainer()->getScrolledViewRect(); + if (!mCombinationGalleryPanel->hasVisibleItems()) + { + mCombinationGalleryPanel->handleModifiedFilter(); + } LLRect inv_rect = mCombinationInventoryPanel->getRect(); + LLRect inv_inner_rect = mCombinationInventoryPanel->getScrollableContainer()->getScrolledViewRect(); + LLRect galery_rect = mCombinationGalleryPanel->getRect(); + LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); + inv_rect.mBottom = 0; - inv_rect.mRight = inv_rect.mLeft + inner_rect.getWidth(); + inv_rect.mRight = inv_rect.mLeft + inv_inner_rect.getWidth(); if (!mCombinationGalleryPanel->hasVisibleItems() || mCombinationInventoryPanel->hasVisibleItems()) { - inv_rect.mTop = inv_rect.mBottom + inner_rect.getHeight(); + inv_rect.mTop = inv_rect.mBottom + inv_inner_rect.getHeight(); } else { inv_rect.mTop = inv_rect.mBottom; } - inner_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); - LLRect galery_rect = mCombinationGalleryPanel->getRect(); galery_rect.mBottom = inv_rect.mTop; if (mCombinationGalleryPanel->hasVisibleItems()) { mCombinationGalleryPanel->setVisible(true); - galery_rect.mTop = galery_rect.mBottom + inner_rect.getHeight(); + galery_rect.mTop = galery_rect.mBottom + inner_galery_rect.getHeight(); } else { @@ -2244,16 +2249,9 @@ void LLPanelMainInventory::updateCombinationVisibility() galery_rect.mTop = galery_rect.mBottom; } - LLRect scroller_rect = mCombinationScroller->getRect(); - scroller_rect.mBottom = 0; - scroller_rect.mTop = scroller_rect.mBottom + inv_rect.getHeight() + galery_rect.getHeight(); - scroller_rect.mRight = scroller_rect.mLeft + llmax(inv_rect.getWidth(), galery_rect.getWidth()); - - mCombinationScroller->setRect(scroller_rect); + mCombinationScroller->reshape(llmax(inv_rect.getWidth(), galery_rect.getWidth()), inv_rect.getHeight() + galery_rect.getHeight(), true); mCombinationGalleryPanel->handleReshape(galery_rect, false); mCombinationInventoryPanel->handleReshape(inv_rect, false); - - getActivePanel()->getRootFolder(); } } -- cgit v1.2.3 From 80bfc56ff070614fee5b353056076ebed90f9039 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 28 Apr 2023 19:51:00 +0300 Subject: SL-19583 force reshape inventory panel when changing root in combination view --- indra/newview/llpanelmaininventory.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index b9099bbebf..4d6ff63f94 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2211,6 +2211,9 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) } mForceShowInvLayout = false; updateTitle(); + + //force update scroll container + mCombinationInventoryPanel->reshape(getChild("combination_view_inventory")->getRect().getWidth(), 1, true); } void LLPanelMainInventory::updateCombinationVisibility() @@ -2250,8 +2253,8 @@ void LLPanelMainInventory::updateCombinationVisibility() } mCombinationScroller->reshape(llmax(inv_rect.getWidth(), galery_rect.getWidth()), inv_rect.getHeight() + galery_rect.getHeight(), true); - mCombinationGalleryPanel->handleReshape(galery_rect, false); - mCombinationInventoryPanel->handleReshape(inv_rect, false); + mCombinationGalleryPanel->setShape(galery_rect, false); + mCombinationInventoryPanel->setShape(inv_rect, false); } } -- cgit v1.2.3 From 171b8dbeb32e49d43f40189ae55df05693804fbf Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 2 May 2023 23:07:46 +0300 Subject: SL-19583 Fix rename's width and update frequency This way of calculating scroll turns out to be one large hack. Probably needs a proper combination view instead of combining two different views that have own scrolls or those views need to support not having personal scroll. --- indra/newview/llpanelmaininventory.cpp | 45 +++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 9 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 4d6ff63f94..fc4cc124b8 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -120,6 +120,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mSingleFolderMode(false), mForceShowInvLayout(false), mViewMode(MODE_COMBINATION), + mCombinationShapeDirty(true), mListViewRootUpdatedConnection(), mGalleryRootUpdatedConnection() { @@ -253,6 +254,8 @@ BOOL LLPanelMainInventory::postBuild() mInventoryGalleryPanel = getChild("gallery_view_inv"); mGalleryRootUpdatedConnection = mInventoryGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); + mCombinationScrollPanel = getChild("combination_view_inventory"); + mCombinationInventoryPanel = getChild("comb_single_folder_inv"); LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); comb_inv_filter.setFilterThumbnails(LLInventoryFilter::FILTER_EXCLUDE_THUMBNAILS); @@ -899,9 +902,18 @@ BOOL LLPanelMainInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, } // virtual -void LLPanelMainInventory::changed(U32) +void LLPanelMainInventory::changed(U32 mask) { updateItemcountText(); + if ((mask & LLInventoryObserver::REBUILD) + || (mask & LLInventoryObserver::STRUCTURE) + || (mask & LLInventoryObserver::REMOVE) + || (mask & LLInventoryObserver::ADD) + || (mask & LLInventoryObserver::LABEL)) + { + // todo: can be limited to just observed folder + mCombinationShapeDirty = true; + } } void LLPanelMainInventory::setFocusFilterEditor() @@ -912,6 +924,13 @@ void LLPanelMainInventory::setFocusFilterEditor() } } + +void LLPanelMainInventory::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + mCombinationShapeDirty = true; + LLPanel::reshape(width, height, called_from_parent); +} + // virtual void LLPanelMainInventory::draw() { @@ -1506,9 +1525,9 @@ void LLPanelMainInventory::toggleViewMode() getChild("default_inventory_panel")->setVisible(!mSingleFolderMode); getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); getChild("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode()); - getChild("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode()); getChild("nav_buttons")->setVisible(mSingleFolderMode); getChild("view_mode_btn")->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); + mCombinationScrollPanel->setVisible(mSingleFolderMode && isCombinationViewMode()); setActivePanel(); updateTitle(); @@ -2213,13 +2232,15 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) updateTitle(); //force update scroll container - mCombinationInventoryPanel->reshape(getChild("combination_view_inventory")->getRect().getWidth(), 1, true); + mCombinationShapeDirty = true; } void LLPanelMainInventory::updateCombinationVisibility() { - if(mSingleFolderMode && isCombinationViewMode()) + if(mSingleFolderMode && isCombinationViewMode() && mCombinationShapeDirty) { + mCombinationShapeDirty = false; + mCombinationInventoryPanel->reshape(1,1); // force reduce visible area if (!mCombinationGalleryPanel->hasVisibleItems()) { mCombinationGalleryPanel->handleModifiedFilter(); @@ -2228,12 +2249,17 @@ void LLPanelMainInventory::updateCombinationVisibility() LLRect inv_inner_rect = mCombinationInventoryPanel->getScrollableContainer()->getScrolledViewRect(); LLRect galery_rect = mCombinationGalleryPanel->getRect(); LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); + LLScrollContainer* scroll = static_cast(mCombinationScrollPanel); + LLRect scroller_window_rect = scroll->getContentWindowRect(); + + const S32 BORDER_PAD = 1; + S32 desired_width = llmax(inv_inner_rect.getWidth(), scroller_window_rect.getWidth()) + BORDER_PAD; inv_rect.mBottom = 0; - inv_rect.mRight = inv_rect.mLeft + inv_inner_rect.getWidth(); + inv_rect.mRight = inv_rect.mLeft + desired_width; if (!mCombinationGalleryPanel->hasVisibleItems() || mCombinationInventoryPanel->hasVisibleItems()) { - inv_rect.mTop = inv_rect.mBottom + inv_inner_rect.getHeight(); + inv_rect.mTop = inv_rect.mBottom + inv_inner_rect.getHeight() + BORDER_PAD; } else { @@ -2241,10 +2267,11 @@ void LLPanelMainInventory::updateCombinationVisibility() } galery_rect.mBottom = inv_rect.mTop; + galery_rect.mRight = galery_rect.mLeft + scroller_window_rect.getWidth(); if (mCombinationGalleryPanel->hasVisibleItems()) { mCombinationGalleryPanel->setVisible(true); - galery_rect.mTop = galery_rect.mBottom + inner_galery_rect.getHeight(); + galery_rect.mTop = galery_rect.mBottom + inner_galery_rect.getHeight() + BORDER_PAD; } else { @@ -2252,7 +2279,7 @@ void LLPanelMainInventory::updateCombinationVisibility() galery_rect.mTop = galery_rect.mBottom; } - mCombinationScroller->reshape(llmax(inv_rect.getWidth(), galery_rect.getWidth()), inv_rect.getHeight() + galery_rect.getHeight(), true); + mCombinationScroller->reshape(desired_width, inv_rect.getHeight() + galery_rect.getHeight() + BORDER_PAD, true); mCombinationGalleryPanel->setShape(galery_rect, false); mCombinationInventoryPanel->setShape(inv_rect, false); } @@ -2319,7 +2346,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); getChild("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode()); - getChild("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode()); + mCombinationScrollPanel->setVisible(mSingleFolderMode && isCombinationViewMode()); if(isListViewMode()) { -- cgit v1.2.3 From 1866368673f06084860c30cbd78446f55f600a1e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 3 May 2023 02:06:09 +0300 Subject: SL-19583 Fix height not accounting for borders properly --- indra/newview/llpanelmaininventory.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index fc4cc124b8..0a6ac5f92e 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -287,6 +287,7 @@ BOOL LLPanelMainInventory::postBuild() // Trigger callback for focus received so we can deselect items in inbox/outbox LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this)); + mCombinationShapeDirty = true; return TRUE; } @@ -1964,6 +1965,7 @@ void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility ) } getActivePanel()->getRootFolder()->finishRenamingItem(); } + mCombinationShapeDirty = true; } bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata) @@ -2240,7 +2242,7 @@ void LLPanelMainInventory::updateCombinationVisibility() if(mSingleFolderMode && isCombinationViewMode() && mCombinationShapeDirty) { mCombinationShapeDirty = false; - mCombinationInventoryPanel->reshape(1,1); // force reduce visible area + mCombinationInventoryPanel->reshape(1,1); // HACK: force reduce visible area if (!mCombinationGalleryPanel->hasVisibleItems()) { mCombinationGalleryPanel->handleModifiedFilter(); @@ -2251,9 +2253,8 @@ void LLPanelMainInventory::updateCombinationVisibility() LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); LLScrollContainer* scroll = static_cast(mCombinationScrollPanel); LLRect scroller_window_rect = scroll->getContentWindowRect(); - - const S32 BORDER_PAD = 1; - S32 desired_width = llmax(inv_inner_rect.getWidth(), scroller_window_rect.getWidth()) + BORDER_PAD; + S32 desired_width = llmax(inv_inner_rect.getWidth(), scroller_window_rect.getWidth()); + const S32 BORDER_PAD = 2; // two sides inv_rect.mBottom = 0; inv_rect.mRight = inv_rect.mLeft + desired_width; @@ -2279,7 +2280,7 @@ void LLPanelMainInventory::updateCombinationVisibility() galery_rect.mTop = galery_rect.mBottom; } - mCombinationScroller->reshape(desired_width, inv_rect.getHeight() + galery_rect.getHeight() + BORDER_PAD, true); + mCombinationScroller->reshape(desired_width, inv_rect.getHeight() + galery_rect.getHeight(), true); mCombinationGalleryPanel->setShape(galery_rect, false); mCombinationInventoryPanel->setShape(inv_rect, false); } -- cgit v1.2.3 From b3e02c4264a8a3b9d189b347d0faddf3ac21e87b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 3 May 2023 18:46:18 +0300 Subject: SL-19583 Scroll fixes --- indra/newview/llpanelmaininventory.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 0a6ac5f92e..3110adff15 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -736,6 +736,8 @@ void LLPanelMainInventory::onClearSearch() inbox_panel->onClearSearch(); } } + + mCombinationShapeDirty = true; } void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) @@ -793,6 +795,8 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) inbox_panel->onFilterEdit(search_string); } } + + mCombinationShapeDirty = true; } @@ -1681,6 +1685,8 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool mCombinationInventoryPanel->changeFolderRoot(folder_id); } updateNavButtons(); + + mCombinationShapeDirty = true; } LLUUID LLPanelMainInventory::getSingleFolderViewRoot() @@ -2235,14 +2241,20 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) //force update scroll container mCombinationShapeDirty = true; + mCombinationInventoryPanel->reshape(1, 1); } void LLPanelMainInventory::updateCombinationVisibility() { - if(mSingleFolderMode && isCombinationViewMode() && mCombinationShapeDirty) + if(mSingleFolderMode + && isCombinationViewMode() + && mCombinationShapeDirty) { - mCombinationShapeDirty = false; - mCombinationInventoryPanel->reshape(1,1); // HACK: force reduce visible area + if (mCombinationInventoryPanel->areViewsInitialized()) + { + mCombinationShapeDirty = false; + mCombinationInventoryPanel->reshape(1,1); // HACK: force reduce visible area + } if (!mCombinationGalleryPanel->hasVisibleItems()) { mCombinationGalleryPanel->handleModifiedFilter(); @@ -2253,8 +2265,8 @@ void LLPanelMainInventory::updateCombinationVisibility() LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); LLScrollContainer* scroll = static_cast(mCombinationScrollPanel); LLRect scroller_window_rect = scroll->getContentWindowRect(); - S32 desired_width = llmax(inv_inner_rect.getWidth(), scroller_window_rect.getWidth()); const S32 BORDER_PAD = 2; // two sides + S32 desired_width = llmax(inv_inner_rect.getWidth(), scroller_window_rect.getWidth() - BORDER_PAD); inv_rect.mBottom = 0; inv_rect.mRight = inv_rect.mLeft + desired_width; -- cgit v1.2.3 From 25277a773db9311ecddb80febe623240769c0636 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 4 May 2023 19:19:32 +0300 Subject: SL-19683 Add menu items should be disabled for some folders in single-folder view --- indra/newview/llpanelmaininventory.cpp | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 3110adff15..b0422b7bd9 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1494,6 +1494,7 @@ void LLPanelMainInventory::onAddButtonClick() LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get(); if (menu) { + disableAddIfNeeded(); menu->getChild("New Folder")->setEnabled(!isRecentItemsPanelSelected()); setUploadCostIfNeeded(); @@ -2199,6 +2200,55 @@ void LLPanelMainInventory::setUploadCostIfNeeded() } } +bool is_add_allowed(LLUUID folder_id) +{ + if(!gInventory.isObjectDescendentOf(folder_id, gInventory.getRootFolderID())) + { + return false; + } + + std::vector not_allowed_types; + not_allowed_types.push_back(LLFolderType::FT_LOST_AND_FOUND); + not_allowed_types.push_back(LLFolderType::FT_FAVORITE); + not_allowed_types.push_back(LLFolderType::FT_MARKETPLACE_LISTINGS); + not_allowed_types.push_back(LLFolderType::FT_TRASH); + not_allowed_types.push_back(LLFolderType::FT_CURRENT_OUTFIT); + not_allowed_types.push_back(LLFolderType::FT_INBOX); + + for (std::vector::const_iterator it = not_allowed_types.begin(); + it != not_allowed_types.end(); ++it) + { + if(gInventory.isObjectDescendentOf(folder_id, gInventory.findCategoryUUIDForType(*it))) + { + return false; + } + } + + LLViewerInventoryCategory* cat = gInventory.getCategory(folder_id); + if (cat && (cat->getPreferredType() == LLFolderType::FT_OUTFIT)) + { + return false; + } + return true; +} + +void LLPanelMainInventory::disableAddIfNeeded() +{ + LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get(); + if (menu) + { + bool enable = !mSingleFolderMode || is_add_allowed(getCurrentSFVRoot()); + + menu->getChild("New Folder")->setEnabled(enable); + menu->getChild("New Script")->setEnabled(enable); + menu->getChild("New Note")->setEnabled(enable); + menu->getChild("New Gesture")->setEnabled(enable); + menu->setItemEnabled("New Clothes", enable); + menu->setItemEnabled("New Body Parts", enable); + menu->setItemEnabled("New Settings", enable); + } +} + bool LLPanelMainInventory::hasSettingsInventory() { return LLEnvironment::instance().isInventoryEnabled(); -- cgit v1.2.3 From 61818417d619c8d17cf861f0d72b314a14269e2f Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 5 May 2023 18:17:00 +0300 Subject: SL-19641 FIXED Gallery item is not selected after using 'Find original' --- indra/newview/llpanelmaininventory.cpp | 70 +++++++++++++++++++++++++++++++--- 1 file changed, 64 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index b0422b7bd9..2f6276ff77 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -122,7 +122,9 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mViewMode(MODE_COMBINATION), mCombinationShapeDirty(true), mListViewRootUpdatedConnection(), - mGalleryRootUpdatedConnection() + mGalleryRootUpdatedConnection(), + mDelayedCombGalleryScroll(false), + mDelayedCombInvPanelScroll(false) { // Menu Callbacks (non contex menus) mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelMainInventory::doToSelected, this, _2)); @@ -466,7 +468,7 @@ void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_sele main_inventory->setFocus(true); if(item_to_select.notNull()) { - sidepanel_inventory->getActivePanel()->setSelection(item_to_select, TAKE_FOCUS_YES); + main_inventory->setGallerySelection(item_to_select); } return; } @@ -491,7 +493,7 @@ void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_sele main_inventory->setSingleFolderViewRoot(folder_id); if(item_to_select.notNull()) { - sidepanel_inventory->getActivePanel()->setSelection(item_to_select, TAKE_FOCUS_YES); + main_inventory->setGallerySelection(item_to_select, true); } } } @@ -2345,6 +2347,15 @@ void LLPanelMainInventory::updateCombinationVisibility() mCombinationScroller->reshape(desired_width, inv_rect.getHeight() + galery_rect.getHeight(), true); mCombinationGalleryPanel->setShape(galery_rect, false); mCombinationInventoryPanel->setShape(inv_rect, false); + + if(mDelayedCombGalleryScroll) + { + scrollToGallerySelection(); + } + else if(mDelayedCombInvPanelScroll) + { + scrollToInvPanelSelection(); + } } } @@ -2478,7 +2489,7 @@ LLInventoryFilter& LLPanelMainInventory::getCurrentFilter() } } -void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id) +void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id, bool new_window) { if(mSingleFolderMode && isGalleryViewMode()) { @@ -2488,13 +2499,60 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id) { if(mCombinationGalleryPanel->getFilter().checkAgainstFilterThumbnails(item_id)) { - mCombinationGalleryPanel->changeItemSelection(item_id, true); + mCombinationGalleryPanel->changeItemSelection(item_id, false); + if(new_window) + { + mDelayedCombGalleryScroll = new_window; + } + else + { + scrollToGallerySelection(); + } } else { - mCombinationInventoryPanel->setSelection(item_id, false); + mCombinationInventoryPanel->setSelection(item_id, true); + if(new_window) + { + mDelayedCombInvPanelScroll = new_window; + } + else + { + scrollToInvPanelSelection(); + } } } + else if (mSingleFolderMode && isListViewMode()) + { + mSingleFolderPanelInventory->setSelection(item_id, true); + } +} + +void LLPanelMainInventory::scrollToGallerySelection() +{ + LLInventoryGalleryItem* item = mCombinationGalleryPanel->getSelectedItem(); + LLScrollContainer* scroll_panel = getChild("combination_view_inventory"); + + if(item) + { + LLRect item_rect; + item->localRectToOtherView(item->getLocalRect(), &item_rect, mCombinationScroller); + scroll_panel->scrollToShowRect(item_rect); + } } + +void LLPanelMainInventory::scrollToInvPanelSelection() +{ + LLFolderViewItem* item = mCombinationInventoryPanel->getRootFolder()->getCurSelectedItem(); + LLScrollContainer* scroll_panel = getChild("combination_view_inventory"); + + if(item) + { + LLRect item_rect; + item->localRectToOtherView(item->getLocalRect(), &item_rect, mCombinationScroller); + scroll_panel->scrollToShowRect(item_rect); + } +} + // List Commands // //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 03ed823e5993acf874289e6439e6df31732e4743 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 6 May 2023 02:33:39 +0300 Subject: SL-19688 Fix combined view not updating on thumbnail change --- indra/newview/llpanelmaininventory.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 2f6276ff77..c57ff26b91 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -916,6 +916,7 @@ void LLPanelMainInventory::changed(U32 mask) || (mask & LLInventoryObserver::STRUCTURE) || (mask & LLInventoryObserver::REMOVE) || (mask & LLInventoryObserver::ADD) + || (mask & LLInventoryObserver::INTERNAL) // Thumbnail || (mask & LLInventoryObserver::LABEL)) { // todo: can be limited to just observed folder -- cgit v1.2.3 From eaf95d084a585c8a0a9ac086679487fa40e1db71 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 6 May 2023 03:17:45 +0300 Subject: SL-19689 In combination view 'raname' field doesn't update position properly --- indra/newview/llpanelmaininventory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index c57ff26b91..06b71d0f7a 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2357,6 +2357,12 @@ void LLPanelMainInventory::updateCombinationVisibility() { scrollToInvPanelSelection(); } + + LLFolderView* root_folder = mCombinationInventoryPanel->getRootFolder(); + if (root_folder) + { + root_folder->updateRenamerPosition(); + } } } -- cgit v1.2.3 From 06f63d9b871458f71340ba7d0126bf964d17048f Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 10 May 2023 12:02:09 +0300 Subject: SL-19683 'New folder' menu item should be disable for the listed folders in sfv --- indra/newview/llpanelmaininventory.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 06b71d0f7a..4577c1defa 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1498,7 +1498,6 @@ void LLPanelMainInventory::onAddButtonClick() if (menu) { disableAddIfNeeded(); - menu->getChild("New Folder")->setEnabled(!isRecentItemsPanelSelected()); setUploadCostIfNeeded(); @@ -2242,7 +2241,7 @@ void LLPanelMainInventory::disableAddIfNeeded() { bool enable = !mSingleFolderMode || is_add_allowed(getCurrentSFVRoot()); - menu->getChild("New Folder")->setEnabled(enable); + menu->getChild("New Folder")->setEnabled(enable && !isRecentItemsPanelSelected()); menu->getChild("New Script")->setEnabled(enable); menu->getChild("New Note")->setEnabled(enable); menu->getChild("New Gesture")->setEnabled(enable); -- cgit v1.2.3 From 8a1cb8c00cf75ff1e09c72c2fb487728ec77c66b Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 10 May 2023 12:51:08 +0300 Subject: SL-19697 FIXED Clicking on inventory item in list view does not unselect item in gallery view --- indra/newview/llpanelmaininventory.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') 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("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("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& items, BOOL user_action) +{ + onSelectionChange(mCombinationInventoryPanel, items, user_action); + + if(!items.empty()) + { + mCombinationGalleryPanel->clearSelection(); + } +} + void LLPanelMainInventory::updateCombinationVisibility() { if(mSingleFolderMode -- cgit v1.2.3 From a6d867bccea37467d51cd037d6a58aca02a27e97 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 12 May 2023 21:14:14 +0300 Subject: SL-19583 Fix scrollbars flashing when resizing floater --- indra/newview/llpanelmaininventory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a8c8ce994d..5a8565b5aa 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -938,6 +938,7 @@ void LLPanelMainInventory::reshape(S32 width, S32 height, BOOL called_from_paren { mCombinationShapeDirty = true; LLPanel::reshape(width, height, called_from_parent); + updateCombinationVisibility(); } // virtual @@ -959,9 +960,9 @@ void LLPanelMainInventory::draw() mResortActivePanel = false; } + updateCombinationVisibility(); LLPanel::draw(); updateItemcountText(); - updateCombinationVisibility(); } void LLPanelMainInventory::updateItemcountText() -- cgit v1.2.3 From 572e8269bcd5320daa66f4074e927c79869bf7de Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 24 May 2023 22:51:02 +0300 Subject: SL-19604 Creating new folders in combination views does not highlight created item --- indra/newview/llpanelmaininventory.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5a8565b5aa..998a211795 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -256,7 +256,7 @@ BOOL LLPanelMainInventory::postBuild() mInventoryGalleryPanel = getChild("gallery_view_inv"); mGalleryRootUpdatedConnection = mInventoryGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); - mCombinationScrollPanel = getChild("combination_view_inventory"); + mCombinationScrollPanel = getChild("combination_view_inventory"); mCombinationInventoryPanel = getChild("comb_single_folder_inv"); LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); @@ -264,6 +264,7 @@ BOOL LLPanelMainInventory::postBuild() comb_inv_filter.markDefault(); mCombinationInventoryPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onCombinationInventorySelectionChanged, this, _1, _2)); mCombinationInventoryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); + mCombinationInventoryPanel->setScroller(mCombinationScrollPanel); mCombinationGalleryPanel = getChild("comb_gallery_view_inv"); LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter(); @@ -2326,6 +2327,11 @@ void LLPanelMainInventory::updateCombinationVisibility() { mCombinationShapeDirty = false; mCombinationInventoryPanel->reshape(1,1); // HACK: force reduce visible area + LLFolderView* root_folder = mCombinationInventoryPanel->getRootFolder(); + if (root_folder) + { + root_folder->arrangeAll(); + } } if (!mCombinationGalleryPanel->hasVisibleItems()) { @@ -2335,13 +2341,11 @@ void LLPanelMainInventory::updateCombinationVisibility() LLRect inv_inner_rect = mCombinationInventoryPanel->getScrollableContainer()->getScrolledViewRect(); LLRect galery_rect = mCombinationGalleryPanel->getRect(); LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); - LLScrollContainer* scroll = static_cast(mCombinationScrollPanel); - LLRect scroller_window_rect = scroll->getContentWindowRect(); + LLRect scroller_window_rect = mCombinationScrollPanel->getContentWindowRect(); const S32 BORDER_PAD = 2; // two sides - S32 desired_width = llmax(inv_inner_rect.getWidth(), scroller_window_rect.getWidth() - BORDER_PAD); inv_rect.mBottom = 0; - inv_rect.mRight = inv_rect.mLeft + desired_width; + inv_rect.mRight = inv_rect.mLeft + inv_inner_rect.getWidth(); if (!mCombinationGalleryPanel->hasVisibleItems() || mCombinationInventoryPanel->hasVisibleItems()) { inv_rect.mTop = inv_rect.mBottom + inv_inner_rect.getHeight() + BORDER_PAD; @@ -2364,7 +2368,7 @@ void LLPanelMainInventory::updateCombinationVisibility() galery_rect.mTop = galery_rect.mBottom; } - mCombinationScroller->reshape(desired_width, inv_rect.getHeight() + galery_rect.getHeight(), true); + mCombinationScroller->reshape(scroller_window_rect.getWidth(), inv_rect.getHeight() + galery_rect.getHeight(), true); mCombinationGalleryPanel->setShape(galery_rect, false); mCombinationInventoryPanel->setShape(inv_rect, false); @@ -2376,12 +2380,6 @@ void LLPanelMainInventory::updateCombinationVisibility() { scrollToInvPanelSelection(); } - - LLFolderView* root_folder = mCombinationInventoryPanel->getRootFolder(); - if (root_folder) - { - root_folder->updateRenamerPosition(); - } } } -- cgit v1.2.3 From 8c9edebde752d69cfc120a1ddaf5dd7d6f6c27c4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 26 May 2023 23:02:54 +0300 Subject: SL-19604 Properly account for borders --- indra/newview/llpanelmaininventory.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 998a211795..39add4ee1c 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2342,17 +2342,16 @@ void LLPanelMainInventory::updateCombinationVisibility() LLRect galery_rect = mCombinationGalleryPanel->getRect(); LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); LLRect scroller_window_rect = mCombinationScrollPanel->getContentWindowRect(); - const S32 BORDER_PAD = 2; // two sides inv_rect.mBottom = 0; - inv_rect.mRight = inv_rect.mLeft + inv_inner_rect.getWidth(); + inv_rect.mRight = inv_rect.mLeft + inv_inner_rect.getWidth() + mCombinationInventoryPanel->getScrollableContainer()->getBorderWidth(); if (!mCombinationGalleryPanel->hasVisibleItems() || mCombinationInventoryPanel->hasVisibleItems()) { - inv_rect.mTop = inv_rect.mBottom + inv_inner_rect.getHeight() + BORDER_PAD; + inv_rect.mTop = inv_rect.mBottom + inv_inner_rect.getHeight() + mCombinationInventoryPanel->getScrollableContainer()->getBorderWidth(); } else { - inv_rect.mTop = inv_rect.mBottom; + inv_rect.mTop = inv_rect.mBottom + mCombinationInventoryPanel->getScrollableContainer()->getBorderWidth(); } galery_rect.mBottom = inv_rect.mTop; @@ -2360,12 +2359,12 @@ void LLPanelMainInventory::updateCombinationVisibility() if (mCombinationGalleryPanel->hasVisibleItems()) { mCombinationGalleryPanel->setVisible(true); - galery_rect.mTop = galery_rect.mBottom + inner_galery_rect.getHeight() + BORDER_PAD; + galery_rect.mTop = galery_rect.mBottom + inner_galery_rect.getHeight() + mCombinationGalleryPanel->getScrollableContainer()->getBorderWidth(); } else { mCombinationGalleryPanel->setVisible(false); - galery_rect.mTop = galery_rect.mBottom; + galery_rect.mTop = galery_rect.mBottom + mCombinationGalleryPanel->getScrollableContainer()->getBorderWidth(); } mCombinationScroller->reshape(scroller_window_rect.getWidth(), inv_rect.getHeight() + galery_rect.getHeight(), true); -- cgit v1.2.3 From a6efb920e8e0d9add76ec86c3ed158c691685727 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 31 May 2023 01:09:57 +0300 Subject: SL-19795 Creating folders in combination mode does not scroll to new folder #2 --- indra/newview/llpanelmaininventory.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 39add4ee1c..381506c2a6 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1011,9 +1011,12 @@ void LLPanelMainInventory::updateItemcountText() gInventory.getDirectDescendentsOf(getCurrentSFVRoot(), cats, items); - string_args["[ITEM_COUNT]"] = llformat("%d", items->size()); - string_args["[CATEGORY_COUNT]"] = llformat("%d", cats->size()); - text = getString("ItemcountCompleted", string_args); + if (items && cats) + { + string_args["[ITEM_COUNT]"] = llformat("%d", items->size()); + string_args["[CATEGORY_COUNT]"] = llformat("%d", cats->size()); + text = getString("ItemcountCompleted", string_args); + } } mCounterCtrl->setValue(text); @@ -1532,6 +1535,13 @@ void LLPanelMainInventory::toggleViewMode() } mSingleFolderMode = !mSingleFolderMode; + mCombinationShapeDirty = true; + + if (mCombinationGalleryPanel->getRootFolder().isNull()) + { + mCombinationGalleryPanel->setRootFolder(mCombinationInventoryPanel->getSingleFolderRoot()); + mCombinationGalleryPanel->updateRootFolder(); + } getChild("default_inventory_panel")->setVisible(!mSingleFolderMode); getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); -- cgit v1.2.3 From c3e200cef41a602c13d3115cfec777eff63d5028 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 31 May 2023 17:03:19 +0300 Subject: SL-19686 don't search views every time --- indra/newview/llpanelmaininventory.cpp | 38 +++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 381506c2a6..16f7abee23 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -249,6 +249,16 @@ BOOL LLPanelMainInventory::postBuild() mVisibilityMenuButton = getChild("options_visibility_btn"); mViewMenuButton = getChild("view_btn"); + mBackBtn = getChild("back_btn"); + mForwardBtn = getChild("forward_btn"); + mUpBtn = getChild("up_btn"); + mViewModeBtn = getChild("view_mode_btn"); + mNavigationBtnsPanel = getChild("nav_buttons"); + + mDefaultViewPanel = getChild("default_inventory_panel"); + mListViewPanel = getChild("single_folder_inventory"); + mGalleryViewPanel = getChild("gallery_view_inventory"); + mSingleFolderPanelInventory = getChild("single_folder_inv"); mListViewRootUpdatedConnection = mSingleFolderPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); mSingleFolderPanelInventory->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mSingleFolderPanelInventory, _1, _2)); @@ -1543,11 +1553,11 @@ void LLPanelMainInventory::toggleViewMode() mCombinationGalleryPanel->updateRootFolder(); } - getChild("default_inventory_panel")->setVisible(!mSingleFolderMode); - getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); - getChild("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode()); - getChild("nav_buttons")->setVisible(mSingleFolderMode); - getChild("view_mode_btn")->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); + mDefaultViewPanel->setVisible(!mSingleFolderMode); + mListViewPanel->setVisible(mSingleFolderMode && isListViewMode()); + mGalleryViewPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); + mNavigationBtnsPanel->setVisible(mSingleFolderMode); + mViewModeBtn->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); mCombinationScrollPanel->setVisible(mSingleFolderMode && isCombinationViewMode()); setActivePanel(); @@ -2396,23 +2406,23 @@ void LLPanelMainInventory::updateNavButtons() { if(isListViewMode()) { - getChild("back_btn")->setEnabled(mSingleFolderPanelInventory->isBackwardAvailable()); - getChild("forward_btn")->setEnabled(mSingleFolderPanelInventory->isForwardAvailable()); + mBackBtn->setEnabled(mSingleFolderPanelInventory->isBackwardAvailable()); + mForwardBtn->setEnabled(mSingleFolderPanelInventory->isForwardAvailable()); } if(isGalleryViewMode()) { - getChild("back_btn")->setEnabled(mInventoryGalleryPanel->isBackwardAvailable()); - getChild("forward_btn")->setEnabled(mInventoryGalleryPanel->isForwardAvailable()); + mBackBtn->setEnabled(mInventoryGalleryPanel->isBackwardAvailable()); + mForwardBtn->setEnabled(mInventoryGalleryPanel->isForwardAvailable()); } if(isCombinationViewMode()) { - getChild("back_btn")->setEnabled(mCombinationInventoryPanel->isBackwardAvailable()); - getChild("forward_btn")->setEnabled(mCombinationInventoryPanel->isForwardAvailable()); + mBackBtn->setEnabled(mCombinationInventoryPanel->isBackwardAvailable()); + mForwardBtn->setEnabled(mCombinationInventoryPanel->isForwardAvailable()); } const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot()); bool up_enabled = (cat && cat->getParentUUID().notNull()); - getChild("up_btn")->setEnabled(up_enabled); + mUpBtn->setEnabled(up_enabled); } LLSidepanelInventory* LLPanelMainInventory::getParentSidepanelInventory() @@ -2451,8 +2461,8 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) LLUUID cur_root = getCurrentSFVRoot(); mViewMode = mode; - getChild("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode()); - getChild("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode()); + mListViewPanel->setVisible(mSingleFolderMode && isListViewMode()); + mGalleryViewPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); mCombinationScrollPanel->setVisible(mSingleFolderMode && isCombinationViewMode()); if(isListViewMode()) -- cgit v1.2.3 From 23311903106293f29e22d21314bdab03bbd499f7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 31 May 2023 19:28:48 +0300 Subject: Revert "SL-19795 Unified scroll" --- indra/newview/llpanelmaininventory.cpp | 132 +++++---------------------------- 1 file changed, 18 insertions(+), 114 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 16f7abee23..f3241c6e5e 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -120,7 +120,6 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mSingleFolderMode(false), mForceShowInvLayout(false), mViewMode(MODE_COMBINATION), - mCombinationShapeDirty(true), mListViewRootUpdatedConnection(), mGalleryRootUpdatedConnection(), mDelayedCombGalleryScroll(false), @@ -258,6 +257,7 @@ BOOL LLPanelMainInventory::postBuild() mDefaultViewPanel = getChild("default_inventory_panel"); mListViewPanel = getChild("single_folder_inventory"); mGalleryViewPanel = getChild("gallery_view_inventory"); + mCombinationViewPanel = getChild("combination_view_inventory"); mSingleFolderPanelInventory = getChild("single_folder_inv"); mListViewRootUpdatedConnection = mSingleFolderPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); @@ -266,15 +266,12 @@ BOOL LLPanelMainInventory::postBuild() mInventoryGalleryPanel = getChild("gallery_view_inv"); mGalleryRootUpdatedConnection = mInventoryGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); - mCombinationScrollPanel = getChild("combination_view_inventory"); - mCombinationInventoryPanel = getChild("comb_single_folder_inv"); LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); comb_inv_filter.setFilterThumbnails(LLInventoryFilter::FILTER_EXCLUDE_THUMBNAILS); comb_inv_filter.markDefault(); mCombinationInventoryPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onCombinationInventorySelectionChanged, this, _1, _2)); mCombinationInventoryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); - mCombinationInventoryPanel->setScroller(mCombinationScrollPanel); mCombinationGalleryPanel = getChild("comb_gallery_view_inv"); LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter(); @@ -283,8 +280,6 @@ BOOL LLPanelMainInventory::postBuild() mCombinationGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, true)); mCombinationGalleryPanel->setSelectionChangeCallback(boost::bind(&LLPanelMainInventory::onCombinationGallerySelectionChanged, this, _1)); - mCombinationScroller = getChild("combination_scroller"); - initListCommandsHandlers(); const std::string texture_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost()); @@ -301,7 +296,6 @@ BOOL LLPanelMainInventory::postBuild() // Trigger callback for focus received so we can deselect items in inbox/outbox LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this)); - mCombinationShapeDirty = true; return TRUE; } @@ -750,8 +744,6 @@ void LLPanelMainInventory::onClearSearch() inbox_panel->onClearSearch(); } } - - mCombinationShapeDirty = true; } void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) @@ -809,8 +801,6 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) inbox_panel->onFilterEdit(search_string); } } - - mCombinationShapeDirty = true; } @@ -921,19 +911,9 @@ BOOL LLPanelMainInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, } // virtual -void LLPanelMainInventory::changed(U32 mask) +void LLPanelMainInventory::changed(U32) { updateItemcountText(); - if ((mask & LLInventoryObserver::REBUILD) - || (mask & LLInventoryObserver::STRUCTURE) - || (mask & LLInventoryObserver::REMOVE) - || (mask & LLInventoryObserver::ADD) - || (mask & LLInventoryObserver::INTERNAL) // Thumbnail - || (mask & LLInventoryObserver::LABEL)) - { - // todo: can be limited to just observed folder - mCombinationShapeDirty = true; - } } void LLPanelMainInventory::setFocusFilterEditor() @@ -944,14 +924,6 @@ void LLPanelMainInventory::setFocusFilterEditor() } } - -void LLPanelMainInventory::reshape(S32 width, S32 height, BOOL called_from_parent) -{ - mCombinationShapeDirty = true; - LLPanel::reshape(width, height, called_from_parent); - updateCombinationVisibility(); -} - // virtual void LLPanelMainInventory::draw() { @@ -970,10 +942,9 @@ void LLPanelMainInventory::draw() mActivePanel->setSortOrder(order); mResortActivePanel = false; } - - updateCombinationVisibility(); LLPanel::draw(); updateItemcountText(); + updateCombinationVisibility(); } void LLPanelMainInventory::updateItemcountText() @@ -1545,7 +1516,6 @@ void LLPanelMainInventory::toggleViewMode() } mSingleFolderMode = !mSingleFolderMode; - mCombinationShapeDirty = true; if (mCombinationGalleryPanel->getRootFolder().isNull()) { @@ -1556,9 +1526,9 @@ void LLPanelMainInventory::toggleViewMode() mDefaultViewPanel->setVisible(!mSingleFolderMode); mListViewPanel->setVisible(mSingleFolderMode && isListViewMode()); mGalleryViewPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); + mCombinationViewPanel->setVisible(mSingleFolderMode && isCombinationViewMode()); mNavigationBtnsPanel->setVisible(mSingleFolderMode); mViewModeBtn->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); - mCombinationScrollPanel->setVisible(mSingleFolderMode && isCombinationViewMode()); setActivePanel(); updateTitle(); @@ -1711,8 +1681,6 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool mCombinationInventoryPanel->changeFolderRoot(folder_id); } updateNavButtons(); - - mCombinationShapeDirty = true; } LLUUID LLPanelMainInventory::getSingleFolderViewRoot() @@ -1997,7 +1965,6 @@ void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility ) } getActivePanel()->getRootFolder()->finishRenamingItem(); } - mCombinationShapeDirty = true; } bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata) @@ -2313,10 +2280,6 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) } mForceShowInvLayout = false; updateTitle(); - - //force update scroll container - mCombinationShapeDirty = true; - mCombinationInventoryPanel->reshape(1, 1); } void LLPanelMainInventory::onCombinationGallerySelectionChanged(const LLUUID& category_id) @@ -2339,66 +2302,23 @@ void LLPanelMainInventory::onCombinationInventorySelectionChanged(const std::deq void LLPanelMainInventory::updateCombinationVisibility() { - if(mSingleFolderMode - && isCombinationViewMode() - && mCombinationShapeDirty) + if(mSingleFolderMode && isCombinationViewMode()) { - if (mCombinationInventoryPanel->areViewsInitialized()) + bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); + bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout; + getChild("comb_gallery_layout")->setVisible(!is_gallery_empty); + getChild("comb_inventory_layout")->setVisible(show_inv_pane); + mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane); + if(mCombinationInventoryPanel->hasVisibleItems()) { - mCombinationShapeDirty = false; - mCombinationInventoryPanel->reshape(1,1); // HACK: force reduce visible area - LLFolderView* root_folder = mCombinationInventoryPanel->getRootFolder(); - if (root_folder) - { - root_folder->arrangeAll(); - } + mForceShowInvLayout = false; } - if (!mCombinationGalleryPanel->hasVisibleItems()) + if(is_gallery_empty) { mCombinationGalleryPanel->handleModifiedFilter(); } - LLRect inv_rect = mCombinationInventoryPanel->getRect(); - LLRect inv_inner_rect = mCombinationInventoryPanel->getScrollableContainer()->getScrolledViewRect(); - LLRect galery_rect = mCombinationGalleryPanel->getRect(); - LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); - LLRect scroller_window_rect = mCombinationScrollPanel->getContentWindowRect(); - - inv_rect.mBottom = 0; - inv_rect.mRight = inv_rect.mLeft + inv_inner_rect.getWidth() + mCombinationInventoryPanel->getScrollableContainer()->getBorderWidth(); - if (!mCombinationGalleryPanel->hasVisibleItems() || mCombinationInventoryPanel->hasVisibleItems()) - { - inv_rect.mTop = inv_rect.mBottom + inv_inner_rect.getHeight() + mCombinationInventoryPanel->getScrollableContainer()->getBorderWidth(); - } - else - { - inv_rect.mTop = inv_rect.mBottom + mCombinationInventoryPanel->getScrollableContainer()->getBorderWidth(); - } - - galery_rect.mBottom = inv_rect.mTop; - galery_rect.mRight = galery_rect.mLeft + scroller_window_rect.getWidth(); - if (mCombinationGalleryPanel->hasVisibleItems()) - { - mCombinationGalleryPanel->setVisible(true); - galery_rect.mTop = galery_rect.mBottom + inner_galery_rect.getHeight() + mCombinationGalleryPanel->getScrollableContainer()->getBorderWidth(); - } - else - { - mCombinationGalleryPanel->setVisible(false); - galery_rect.mTop = galery_rect.mBottom + mCombinationGalleryPanel->getScrollableContainer()->getBorderWidth(); - } - - mCombinationScroller->reshape(scroller_window_rect.getWidth(), inv_rect.getHeight() + galery_rect.getHeight(), true); - mCombinationGalleryPanel->setShape(galery_rect, false); - mCombinationInventoryPanel->setShape(inv_rect, false); - - if(mDelayedCombGalleryScroll) - { - scrollToGallerySelection(); - } - else if(mDelayedCombInvPanelScroll) - { - scrollToInvPanelSelection(); - } + + getActivePanel()->getRootFolder(); } } @@ -2463,7 +2383,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) mListViewPanel->setVisible(mSingleFolderMode && isListViewMode()); mGalleryViewPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); - mCombinationScrollPanel->setVisible(mSingleFolderMode && isCombinationViewMode()); + mCombinationViewPanel->setVisible(mSingleFolderMode && isCombinationViewMode()); if(isListViewMode()) { @@ -2573,28 +2493,12 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id, bool new_w void LLPanelMainInventory::scrollToGallerySelection() { - LLInventoryGalleryItem* item = mCombinationGalleryPanel->getSelectedItem(); - LLScrollContainer* scroll_panel = getChild("combination_view_inventory"); - - if(item) - { - LLRect item_rect; - item->localRectToOtherView(item->getLocalRect(), &item_rect, mCombinationScroller); - scroll_panel->scrollToShowRect(item_rect); - } + mCombinationGalleryPanel->scrollToShowItem(mCombinationGalleryPanel->getSelectedItemID()); } void LLPanelMainInventory::scrollToInvPanelSelection() { - LLFolderViewItem* item = mCombinationInventoryPanel->getRootFolder()->getCurSelectedItem(); - LLScrollContainer* scroll_panel = getChild("combination_view_inventory"); - - if(item) - { - LLRect item_rect; - item->localRectToOtherView(item->getLocalRect(), &item_rect, mCombinationScroller); - scroll_panel->scrollToShowRect(item_rect); - } + mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection(); } // List Commands // -- cgit v1.2.3 From 49b817d5062dbffb915facc3cda7e31dd2322e6e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 31 May 2023 22:31:24 +0300 Subject: SL-19795 fix inventory list offset --- indra/newview/llpanelmaininventory.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index f3241c6e5e..52cf2f1d54 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -258,6 +258,8 @@ BOOL LLPanelMainInventory::postBuild() mListViewPanel = getChild("single_folder_inventory"); mGalleryViewPanel = getChild("gallery_view_inventory"); mCombinationViewPanel = getChild("combination_view_inventory"); + mCombinationGalleryLayoutPanel = getChild("comb_gallery_layout"); + mCombinationListLayoutPanel = getChild("comb_inventory_layout"); mSingleFolderPanelInventory = getChild("single_folder_inv"); mListViewRootUpdatedConnection = mSingleFolderPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); @@ -2306,8 +2308,8 @@ void LLPanelMainInventory::updateCombinationVisibility() { bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout; - getChild("comb_gallery_layout")->setVisible(!is_gallery_empty); - getChild("comb_inventory_layout")->setVisible(show_inv_pane); + mCombinationGalleryLayoutPanel->setVisible(!is_gallery_empty); + mCombinationListLayoutPanel->setVisible(show_inv_pane); mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane); if(mCombinationInventoryPanel->hasVisibleItems()) { -- cgit v1.2.3 From c6eeb65d18861ea346cf199faba7bf3f493fdabe Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 1 Jun 2023 00:14:06 +0300 Subject: SL-19795 Smarter combination inventory resizing --- indra/newview/llpanelmaininventory.cpp | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 52cf2f1d54..3c867f0e90 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1518,6 +1518,7 @@ void LLPanelMainInventory::toggleViewMode() } mSingleFolderMode = !mSingleFolderMode; + mReshapeInvLayout = true; if (mCombinationGalleryPanel->getRootFolder().isNull()) { @@ -2282,6 +2283,7 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) } mForceShowInvLayout = false; updateTitle(); + mReshapeInvLayout = true; } void LLPanelMainInventory::onCombinationGallerySelectionChanged(const LLUUID& category_id) @@ -2321,6 +2323,55 @@ void LLPanelMainInventory::updateCombinationVisibility() } getActivePanel()->getRootFolder(); + + if (mReshapeInvLayout + && show_inv_pane + && mCombinationGalleryPanel->hasVisibleItems() + && mCombinationInventoryPanel->areViewsInitialized()) + { + mReshapeInvLayout = false; + + // force drop previous shape (because panel doesn't decrease shape properly) + LLRect list_latout = mCombinationListLayoutPanel->getRect(); + list_latout.mTop = list_latout.mBottom; // min height is at 100, so it should snap to be bigger + mCombinationListLayoutPanel->setShape(list_latout, false); + + LLRect inv_inner_rect = mCombinationInventoryPanel->getScrollableContainer()->getScrolledViewRect(); + S32 inv_height = inv_inner_rect.getHeight() + + (mCombinationInventoryPanel->getScrollableContainer()->getBorderWidth() * 2) + + mCombinationInventoryPanel->getScrollableContainer()->getSize(); + LLRect inner_galery_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect(); + S32 gallery_height = inner_galery_rect.getHeight() + + (mCombinationGalleryPanel->getScrollableContainer()->getBorderWidth() * 2) + + mCombinationGalleryPanel->getScrollableContainer()->getSize(); + LLRect layout_rect = mCombinationViewPanel->getRect(); + + // by default make it take 1/3 of the panel + S32 list_default_height = layout_rect.getHeight() / 3; + // Don't set height from gallery_default_height - needs to account for a resizer in such case + S32 gallery_default_height = layout_rect.getHeight() - list_default_height; + + if (inv_height > list_default_height + && gallery_height < gallery_default_height) + { + LLRect gallery_latout = mCombinationGalleryLayoutPanel->getRect(); + gallery_latout.mTop = gallery_latout.mBottom + gallery_height; + mCombinationGalleryLayoutPanel->setShape(gallery_latout, true /*tell stack to account for new shape*/); + } + else if (inv_height < list_default_height + && gallery_height > gallery_default_height) + { + LLRect list_latout = mCombinationListLayoutPanel->getRect(); + list_latout.mTop = list_latout.mBottom + inv_height; + mCombinationListLayoutPanel->setShape(list_latout, true /*tell stack to account for new shape*/); + } + else + { + LLRect list_latout = mCombinationListLayoutPanel->getRect(); + list_latout.mTop = list_latout.mBottom + list_default_height; + mCombinationListLayoutPanel->setShape(list_latout, true /*tell stack to account for new shape*/); + } + } } } -- cgit v1.2.3 From 87d24252df91284eb0cd9ab2f08b376ded05554c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 2 Jun 2023 01:58:30 +0300 Subject: SL-19795 Remove extra panels, reuse combination ones instead --- indra/newview/llpanelmaininventory.cpp | 165 +++++++++++++++++++-------------- 1 file changed, 96 insertions(+), 69 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 3c867f0e90..2939bc2aaf 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -255,31 +255,22 @@ BOOL LLPanelMainInventory::postBuild() mNavigationBtnsPanel = getChild("nav_buttons"); mDefaultViewPanel = getChild("default_inventory_panel"); - mListViewPanel = getChild("single_folder_inventory"); - mGalleryViewPanel = getChild("gallery_view_inventory"); mCombinationViewPanel = getChild("combination_view_inventory"); mCombinationGalleryLayoutPanel = getChild("comb_gallery_layout"); mCombinationListLayoutPanel = getChild("comb_inventory_layout"); - mSingleFolderPanelInventory = getChild("single_folder_inv"); - mListViewRootUpdatedConnection = mSingleFolderPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); - mSingleFolderPanelInventory->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mSingleFolderPanelInventory, _1, _2)); - - mInventoryGalleryPanel = getChild("gallery_view_inv"); - mGalleryRootUpdatedConnection = mInventoryGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); - mCombinationInventoryPanel = getChild("comb_single_folder_inv"); LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); comb_inv_filter.setFilterThumbnails(LLInventoryFilter::FILTER_EXCLUDE_THUMBNAILS); comb_inv_filter.markDefault(); mCombinationInventoryPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onCombinationInventorySelectionChanged, this, _1, _2)); - mCombinationInventoryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); + mListViewRootUpdatedConnection = mCombinationInventoryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); mCombinationGalleryPanel = getChild("comb_gallery_view_inv"); LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter(); comb_gallery_filter.setFilterThumbnails(LLInventoryFilter::FILTER_ONLY_THUMBNAILS); comb_gallery_filter.markDefault(); - mCombinationGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, true)); + mGalleryRootUpdatedConnection = mCombinationGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, true)); mCombinationGalleryPanel->setSelectionChangeCallback(boost::bind(&LLPanelMainInventory::onCombinationGallerySelectionChanged, this, _1)); initListCommandsHandlers(); @@ -652,7 +643,7 @@ void LLPanelMainInventory::setSearchType(LLInventoryFilter::ESearchType type) { if(mSingleFolderMode && isGalleryViewMode()) { - mInventoryGalleryPanel->setSearchType(type); + mCombinationGalleryPanel->setSearchType(type); } if(mSingleFolderMode && isCombinationViewMode()) { @@ -671,7 +662,7 @@ void LLPanelMainInventory::updateSearchTypeCombo() if(mSingleFolderMode && isGalleryViewMode()) { - search_type = mInventoryGalleryPanel->getSearchType(); + search_type = mCombinationGalleryPanel->getSearchType(); } else if(mSingleFolderMode && isCombinationViewMode()) { @@ -753,7 +744,7 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) if(mSingleFolderMode && isGalleryViewMode()) { mFilterSubString = search_string; - mInventoryGalleryPanel->setFilterSubString(mFilterSubString); + mCombinationGalleryPanel->setFilterSubString(mFilterSubString); return; } if(mSingleFolderMode && isCombinationViewMode()) @@ -1282,9 +1273,9 @@ void LLFloaterInventoryFinder::draw() bool is_sf_mode = mPanelMainInventory->isSingleFolderMode(); if(is_sf_mode && mPanelMainInventory->isGalleryViewMode()) { - mPanelMainInventory->mInventoryGalleryPanel->getFilter().setShowFolderState(getCheckShowEmpty() ? + mPanelMainInventory->mCombinationGalleryPanel->getFilter().setShowFolderState(getCheckShowEmpty() ? LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mPanelMainInventory->mInventoryGalleryPanel->getFilter().setFilterObjectTypes(filter); + mPanelMainInventory->mCombinationGalleryPanel->getFilter().setFilterObjectTypes(filter); } else { @@ -1324,9 +1315,9 @@ void LLFloaterInventoryFinder::draw() mPanelMainInventory->setFilterTextFromFilter(); if(is_sf_mode && mPanelMainInventory->isGalleryViewMode()) { - mPanelMainInventory->mInventoryGalleryPanel->getFilter().setHoursAgo(hours); - mPanelMainInventory->mInventoryGalleryPanel->getFilter().setDateRangeLastLogoff(getCheckSinceLogoff()); - mPanelMainInventory->mInventoryGalleryPanel->getFilter().setDateSearchDirection(getDateSearchDirection()); + mPanelMainInventory->mCombinationGalleryPanel->getFilter().setHoursAgo(hours); + mPanelMainInventory->mCombinationGalleryPanel->getFilter().setDateRangeLastLogoff(getCheckSinceLogoff()); + mPanelMainInventory->mCombinationGalleryPanel->getFilter().setDateSearchDirection(getDateSearchDirection()); } else { @@ -1526,13 +1517,7 @@ void LLPanelMainInventory::toggleViewMode() mCombinationGalleryPanel->updateRootFolder(); } - mDefaultViewPanel->setVisible(!mSingleFolderMode); - mListViewPanel->setVisible(mSingleFolderMode && isListViewMode()); - mGalleryViewPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); - mCombinationViewPanel->setVisible(mSingleFolderMode && isCombinationViewMode()); - mNavigationBtnsPanel->setVisible(mSingleFolderMode); - mViewModeBtn->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); - + updatePanelVisibility(); setActivePanel(); updateTitle(); onFilterSelected(); @@ -1615,11 +1600,11 @@ void LLPanelMainInventory::onUpFolderClicked() { if(isListViewMode()) { - mSingleFolderPanelInventory->changeFolderRoot(cat->getParentUUID()); + mCombinationInventoryPanel->changeFolderRoot(cat->getParentUUID()); } if(isGalleryViewMode()) { - mInventoryGalleryPanel->setRootFolder(cat->getParentUUID()); + mCombinationGalleryPanel->setRootFolder(cat->getParentUUID()); } if(isCombinationViewMode()) { @@ -1633,11 +1618,11 @@ void LLPanelMainInventory::onBackFolderClicked() { if(isListViewMode()) { - mSingleFolderPanelInventory->onBackwardFolder(); + mCombinationInventoryPanel->onBackwardFolder(); } if(isGalleryViewMode()) { - mInventoryGalleryPanel->onBackwardFolder(); + mCombinationGalleryPanel->onBackwardFolder(); } if(isCombinationViewMode()) { @@ -1649,11 +1634,11 @@ void LLPanelMainInventory::onForwardFolderClicked() { if(isListViewMode()) { - mSingleFolderPanelInventory->onForwardFolder(); + mCombinationInventoryPanel->onForwardFolder(); } if(isGalleryViewMode()) { - mInventoryGalleryPanel->onForwardFolder(); + mCombinationGalleryPanel->onForwardFolder(); } if(isCombinationViewMode()) { @@ -1665,18 +1650,18 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool { if(isListViewMode()) { - mSingleFolderPanelInventory->changeFolderRoot(folder_id); + mCombinationInventoryPanel->changeFolderRoot(folder_id); if(clear_nav_history) { - mSingleFolderPanelInventory->clearNavigationHistory(); + mCombinationInventoryPanel->clearNavigationHistory(); } } else if(isGalleryViewMode()) { - mInventoryGalleryPanel->setRootFolder(folder_id); + mCombinationGalleryPanel->setRootFolder(folder_id); if(clear_nav_history) { - mInventoryGalleryPanel->clearNavigationHistory(); + mCombinationGalleryPanel->clearNavigationHistory(); } } else if(isCombinationViewMode()) @@ -1688,7 +1673,7 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool LLUUID LLPanelMainInventory::getSingleFolderViewRoot() { - return mSingleFolderPanelInventory->getSingleFolderRoot(); + return mCombinationInventoryPanel->getSingleFolderRoot(); } void LLPanelMainInventory::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) @@ -1716,7 +1701,7 @@ void LLPanelMainInventory::saveTexture(const LLSD& userdata) LLUUID item_id; if(mSingleFolderMode && isGalleryViewMode()) { - item_id = mInventoryGalleryPanel->getSelectedItemID(); + item_id = mCombinationGalleryPanel->getSelectedItemID(); if (item_id.isNull()) return; } else @@ -1814,7 +1799,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) { if(mSingleFolderMode && isGalleryViewMode()) { - LLInventoryObject *obj = gInventory.getObject(mInventoryGalleryPanel->getSelectedItemID()); + LLInventoryObject *obj = gInventory.getObject(mCombinationGalleryPanel->getSelectedItemID()); if (obj && obj->getIsLinkType()) { show_item_original(obj->getUUID()); @@ -1844,7 +1829,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); if (main_inventory) { - LLInventoryObject *obj = gInventory.getObject(mInventoryGalleryPanel->getSelectedItemID()); + LLInventoryObject *obj = gInventory.getObject(mCombinationGalleryPanel->getSelectedItemID()); if (obj) { main_inventory->findLinks(obj->getUUID(), obj->getName()); @@ -1871,7 +1856,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) LLSD params; if(mSingleFolderMode && isGalleryViewMode()) { - params = LLSD(mInventoryGalleryPanel->getSelectedItemID()); + params = LLSD(mCombinationGalleryPanel->getSelectedItemID()); } else { @@ -1931,7 +1916,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) { if(mSingleFolderMode && isGalleryViewMode()) { - std::set uuids{mInventoryGalleryPanel->getSelectedItemID()}; + std::set uuids{ mCombinationGalleryPanel->getSelectedItemID()}; LLAvatarActions::shareWithAvatars(uuids, gFloaterView->getParentFloater(this)); } else @@ -1975,7 +1960,7 @@ bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata) LLViewerInventoryItem *inv_item = NULL; if(mSingleFolderMode && isGalleryViewMode()) { - inv_item = gInventory.getItem(mInventoryGalleryPanel->getSelectedItemID()); + inv_item = gInventory.getItem(mCombinationGalleryPanel->getSelectedItemID()); } else { @@ -2025,7 +2010,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) LLUUID item_id; if(mSingleFolderMode && isGalleryViewMode()) { - item_id = mInventoryGalleryPanel->getSelectedItemID(); + item_id = mCombinationGalleryPanel->getSelectedItemID(); } else{ LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); @@ -2045,7 +2030,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) LLUUID item_id; if(mSingleFolderMode && isGalleryViewMode()) { - item_id = mInventoryGalleryPanel->getSelectedItemID(); + item_id = mCombinationGalleryPanel->getSelectedItemID(); } else{ LLFolderView* root = getActivePanel()->getRootFolder(); @@ -2080,7 +2065,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) { if(mSingleFolderMode && isGalleryViewMode()) { - return can_share_item(mInventoryGalleryPanel->getSelectedItemID()); + return can_share_item(mCombinationGalleryPanel->getSelectedItemID()); } else{ LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); @@ -2304,6 +2289,50 @@ void LLPanelMainInventory::onCombinationInventorySelectionChanged(const std::deq } } +void LLPanelMainInventory::updatePanelVisibility() +{ + mDefaultViewPanel->setVisible(!mSingleFolderMode); + mCombinationViewPanel->setVisible(mSingleFolderMode); + mNavigationBtnsPanel->setVisible(mSingleFolderMode); + mViewModeBtn->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); + + if (mSingleFolderMode) + { + if (isCombinationViewMode()) + { + LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); + comb_inv_filter.setFilterThumbnails(LLInventoryFilter::FILTER_EXCLUDE_THUMBNAILS); + comb_inv_filter.markDefault(); + + LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter(); + comb_gallery_filter.setFilterThumbnails(LLInventoryFilter::FILTER_ONLY_THUMBNAILS); + comb_gallery_filter.markDefault(); + + // visibility will be controled by updateCombinationVisibility() + mCombinationGalleryLayoutPanel->setVisible(true); + mCombinationListLayoutPanel->setVisible(true); + } + else + { + LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); + comb_inv_filter.setFilterThumbnails(LLInventoryFilter::FILTER_INCLUDE_THUMBNAILS); + comb_inv_filter.markDefault(); + + LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter(); + comb_gallery_filter.setFilterThumbnails(LLInventoryFilter::FILTER_INCLUDE_THUMBNAILS); + comb_gallery_filter.markDefault(); + + mCombinationGalleryLayoutPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); + mCombinationListLayoutPanel->setVisible(mSingleFolderMode && isListViewMode()); + } + } + else + { + mCombinationGalleryLayoutPanel->setVisible(false); + mCombinationListLayoutPanel->setVisible(false); + } +} + void LLPanelMainInventory::updateCombinationVisibility() { if(mSingleFolderMode && isCombinationViewMode()) @@ -2379,13 +2408,13 @@ void LLPanelMainInventory::updateNavButtons() { if(isListViewMode()) { - mBackBtn->setEnabled(mSingleFolderPanelInventory->isBackwardAvailable()); - mForwardBtn->setEnabled(mSingleFolderPanelInventory->isForwardAvailable()); + mBackBtn->setEnabled(mCombinationInventoryPanel->isBackwardAvailable()); + mForwardBtn->setEnabled(mCombinationInventoryPanel->isForwardAvailable()); } if(isGalleryViewMode()) { - mBackBtn->setEnabled(mInventoryGalleryPanel->isBackwardAvailable()); - mForwardBtn->setEnabled(mInventoryGalleryPanel->isForwardAvailable()); + mBackBtn->setEnabled(mCombinationGalleryPanel->isBackwardAvailable()); + mForwardBtn->setEnabled(mCombinationGalleryPanel->isForwardAvailable()); } if(isCombinationViewMode()) { @@ -2417,12 +2446,12 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) switch(mViewMode) { case MODE_LIST: - forward_history = mSingleFolderPanelInventory->getNavForwardList(); - backward_history = mSingleFolderPanelInventory->getNavBackwardList(); + forward_history = mCombinationInventoryPanel->getNavForwardList(); + backward_history = mCombinationInventoryPanel->getNavBackwardList(); break; case MODE_GALLERY: - forward_history = mInventoryGalleryPanel->getNavForwardList(); - backward_history = mInventoryGalleryPanel->getNavBackwardList(); + forward_history = mCombinationGalleryPanel->getNavForwardList(); + backward_history = mCombinationGalleryPanel->getNavBackwardList(); break; case MODE_COMBINATION: forward_history = mCombinationInventoryPanel->getNavForwardList(); @@ -2434,21 +2463,19 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) LLUUID cur_root = getCurrentSFVRoot(); mViewMode = mode; - mListViewPanel->setVisible(mSingleFolderMode && isListViewMode()); - mGalleryViewPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); - mCombinationViewPanel->setVisible(mSingleFolderMode && isCombinationViewMode()); + updatePanelVisibility(); if(isListViewMode()) { - mSingleFolderPanelInventory->changeFolderRoot(cur_root); - mSingleFolderPanelInventory->setNavForwardList(forward_history); - mSingleFolderPanelInventory->setNavBackwardList(backward_history); + mCombinationInventoryPanel->changeFolderRoot(cur_root); + mCombinationInventoryPanel->setNavForwardList(forward_history); + mCombinationInventoryPanel->setNavBackwardList(backward_history); } if(isGalleryViewMode()) { - mInventoryGalleryPanel->setRootFolder(cur_root); - mInventoryGalleryPanel->setNavForwardList(forward_history); - mInventoryGalleryPanel->setNavBackwardList(backward_history); + mCombinationGalleryPanel->setRootFolder(cur_root); + mCombinationGalleryPanel->setNavForwardList(forward_history); + mCombinationGalleryPanel->setNavBackwardList(backward_history); } if(isCombinationViewMode()) { @@ -2464,7 +2491,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) onFilterSelected(); if((isListViewMode() && (mActivePanel->getFilterSubString() != mFilterSubString)) || - (isGalleryViewMode() && (mInventoryGalleryPanel->getFilterSubString() != mFilterSubString))) + (isGalleryViewMode() && (mCombinationGalleryPanel->getFilterSubString() != mFilterSubString))) { onFilterEdit(mFilterSubString); } @@ -2480,11 +2507,11 @@ LLUUID LLPanelMainInventory::getCurrentSFVRoot() { if(isListViewMode()) { - return mSingleFolderPanelInventory->getSingleFolderRoot(); + return mCombinationInventoryPanel->getSingleFolderRoot(); } if(isGalleryViewMode()) { - return mInventoryGalleryPanel->getRootFolder(); + return mCombinationGalleryPanel->getRootFolder(); } if(isCombinationViewMode()) { @@ -2497,7 +2524,7 @@ LLInventoryFilter& LLPanelMainInventory::getCurrentFilter() { if(mSingleFolderMode && isGalleryViewMode()) { - return mInventoryGalleryPanel->getFilter(); + return mCombinationGalleryPanel->getFilter(); } else { @@ -2509,7 +2536,7 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id, bool new_w { if(mSingleFolderMode && isGalleryViewMode()) { - mInventoryGalleryPanel->changeItemSelection(item_id, true); + mCombinationGalleryPanel->changeItemSelection(item_id, true); } else if(mSingleFolderMode && isCombinationViewMode()) { @@ -2540,7 +2567,7 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id, bool new_w } else if (mSingleFolderMode && isListViewMode()) { - mSingleFolderPanelInventory->setSelection(item_id, true); + mCombinationInventoryPanel->setSelection(item_id, true); } } -- cgit v1.2.3 From c813a322fb89e94f3666cea3ff16b69127f3dcc1 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 2 Jun 2023 02:47:46 +0300 Subject: SL-19796 Fix inventory autoscroll and autoraneme --- indra/newview/llpanelmaininventory.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 2939bc2aaf..6a5b0eebed 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -517,8 +517,13 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) mForceShowInvLayout = true; } - LLFolderBridge* bridge = (LLFolderBridge*)current_folder->getViewModelItem(); - menu_create_inventory_item(getPanel(), bridge, userdata); + std::function callback_cat_created = [this](const LLUUID& new_category_id) + { + gInventory.notifyObservers(); + mCombinationInventoryPanel->setSelectionByID(new_category_id, TRUE); + mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(TRUE); + }; + menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created); } } else -- cgit v1.2.3 From 959829bb7ef737bd5d9748dd27e074d23974e654 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 2 Jun 2023 02:58:56 +0300 Subject: SL-19796 Small cleanup --- indra/newview/llpanelmaininventory.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 6a5b0eebed..e4de6078f3 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -121,9 +121,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mForceShowInvLayout(false), mViewMode(MODE_COMBINATION), mListViewRootUpdatedConnection(), - mGalleryRootUpdatedConnection(), - mDelayedCombGalleryScroll(false), - mDelayedCombInvPanelScroll(false) + mGalleryRootUpdatedConnection() { // Menu Callbacks (non contex menus) mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelMainInventory::doToSelected, this, _2)); @@ -2548,26 +2546,12 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id, bool new_w if(mCombinationGalleryPanel->getFilter().checkAgainstFilterThumbnails(item_id)) { mCombinationGalleryPanel->changeItemSelection(item_id, false); - if(new_window) - { - mDelayedCombGalleryScroll = new_window; - } - else - { - scrollToGallerySelection(); - } + scrollToGallerySelection(); } else { mCombinationInventoryPanel->setSelection(item_id, true); - if(new_window) - { - mDelayedCombInvPanelScroll = new_window; - } - else - { - scrollToInvPanelSelection(); - } + scrollToInvPanelSelection(); } } else if (mSingleFolderMode && isListViewMode()) -- cgit v1.2.3 From 07fc011e209ab24069d06df961a000dc7d6de3cf Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 2 Jun 2023 21:24:15 +0300 Subject: SL-19796 Creating folders in list mode does not scroll to new folder --- indra/newview/llpanelmaininventory.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e4de6078f3..afb69d9b6d 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -515,11 +515,17 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) mForceShowInvLayout = true; } - std::function callback_cat_created = [this](const LLUUID& new_category_id) + LLHandle handle = mCombinationInventoryPanel->getHandle(); + std::function callback_cat_created = [handle](const LLUUID& new_category_id) { - gInventory.notifyObservers(); - mCombinationInventoryPanel->setSelectionByID(new_category_id, TRUE); - mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(TRUE); + gInventory.notifyObservers(); // not really needed, should have been already done + LLInventorySingleFolderPanel* panel = (LLInventorySingleFolderPanel*)handle.get(); + if (new_category_id.notNull() && panel) + { + panel->setSelectionByID(new_category_id, TRUE); + panel->getRootFolder()->scrollToShowSelection(); + panel->getRootFolder()->setNeedsAutoRename(TRUE); + } }; menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created); } @@ -528,8 +534,11 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) { std::function callback_cat_created = [this](const LLUUID &new_category_id) { - gInventory.notifyObservers(); - setGallerySelection(new_category_id); + gInventory.notifyObservers(); // not really needed, should have been already done + if (new_category_id.notNull()) + { + setGallerySelection(new_category_id); + } }; menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created); } -- cgit v1.2.3 From 2281377c347233b79f76249143e6197142efcfbb Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 6 Jun 2023 12:09:40 +0300 Subject: SL-19813 Disable switch view on Worn and Recent Inventory tabs --- indra/newview/llpanelmaininventory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index afb69d9b6d..0ad4e69942 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1511,6 +1511,7 @@ void LLPanelMainInventory::setActivePanel() { mActivePanel = (LLInventoryPanel*)getChild("inventory filter tabs")->getCurrentPanel(); } + mViewModeBtn->setEnabled(mSingleFolderMode || (getAllItemsPanel() == getActivePanel())); } void LLPanelMainInventory::toggleViewMode() @@ -2307,7 +2308,7 @@ void LLPanelMainInventory::updatePanelVisibility() mCombinationViewPanel->setVisible(mSingleFolderMode); mNavigationBtnsPanel->setVisible(mSingleFolderMode); mViewModeBtn->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn")); - + mViewModeBtn->setEnabled(mSingleFolderMode || (getAllItemsPanel() == getActivePanel())); if (mSingleFolderMode) { if (isCombinationViewMode()) -- cgit v1.2.3 From d5c1d6c24559ce44c7ab6e1249c50bcb04105e5f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 6 Jun 2023 21:44:46 +0300 Subject: SL-19823 Edit not always active when adding items and folders in single folder view --- indra/newview/llpanelmaininventory.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 0ad4e69942..9892360a1b 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -515,16 +515,15 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) mForceShowInvLayout = true; } - LLHandle handle = mCombinationInventoryPanel->getHandle(); + LLHandle handle = getHandle(); std::function callback_cat_created = [handle](const LLUUID& new_category_id) { gInventory.notifyObservers(); // not really needed, should have been already done - LLInventorySingleFolderPanel* panel = (LLInventorySingleFolderPanel*)handle.get(); + LLPanelMainInventory* panel = (LLPanelMainInventory*)handle.get(); if (new_category_id.notNull() && panel) { - panel->setSelectionByID(new_category_id, TRUE); - panel->getRootFolder()->scrollToShowSelection(); - panel->getRootFolder()->setNeedsAutoRename(TRUE); + // might need to refresh visibility, delay rename + panel->mCombInvUUIDNeedsRename = new_category_id; } }; menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created); @@ -532,12 +531,17 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) } else { - std::function callback_cat_created = [this](const LLUUID &new_category_id) + LLHandle handle = getHandle(); + std::function callback_cat_created = [handle](const LLUUID &new_category_id) { gInventory.notifyObservers(); // not really needed, should have been already done if (new_category_id.notNull()) { - setGallerySelection(new_category_id); + LLPanelMainInventory* panel = (LLPanelMainInventory*)handle.get(); + if (panel) + { + panel->setGallerySelection(new_category_id); + } } }; menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created); @@ -2414,6 +2418,14 @@ void LLPanelMainInventory::updateCombinationVisibility() mCombinationListLayoutPanel->setShape(list_latout, true /*tell stack to account for new shape*/); } } + + if (mCombInvUUIDNeedsRename.notNull() && !mReshapeInvLayout) + { + mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, TRUE); + mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection(); + mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(TRUE); + mCombInvUUIDNeedsRename.setNull(); + } } } -- cgit v1.2.3 From 9ac73955faed007e98edf028b4843adcfee0fded Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 6 Jun 2023 22:56:08 +0300 Subject: SL-19823 Edit not always active #2 --- indra/newview/llpanelmaininventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 9892360a1b..a6a68141e3 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2419,7 +2419,7 @@ void LLPanelMainInventory::updateCombinationVisibility() } } - if (mCombInvUUIDNeedsRename.notNull() && !mReshapeInvLayout) + if (mCombInvUUIDNeedsRename.notNull()) { mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, TRUE); mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection(); -- cgit v1.2.3 From 0b16cd0da40e8064b4ebf6b7fc679c0d710a7346 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 7 Jun 2023 00:13:59 +0300 Subject: SL-19823 Edit not active for items --- indra/newview/llpanelmaininventory.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a6a68141e3..a28bc33f15 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -516,35 +516,35 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) } LLHandle handle = getHandle(); - std::function callback_cat_created = [handle](const LLUUID& new_category_id) + std::function callback_created = [handle](const LLUUID& new_id) { gInventory.notifyObservers(); // not really needed, should have been already done LLPanelMainInventory* panel = (LLPanelMainInventory*)handle.get(); - if (new_category_id.notNull() && panel) + if (new_id.notNull() && panel) { // might need to refresh visibility, delay rename - panel->mCombInvUUIDNeedsRename = new_category_id; + panel->mCombInvUUIDNeedsRename = new_id; } }; - menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created); + menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_created); } } else { LLHandle handle = getHandle(); - std::function callback_cat_created = [handle](const LLUUID &new_category_id) + std::function callback_created = [handle](const LLUUID &new_id) { gInventory.notifyObservers(); // not really needed, should have been already done - if (new_category_id.notNull()) + if (new_id.notNull()) { LLPanelMainInventory* panel = (LLPanelMainInventory*)handle.get(); if (panel) { - panel->setGallerySelection(new_category_id); + panel->setGallerySelection(new_id); } } }; - menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_cat_created); + menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_created); } } else -- cgit v1.2.3 From 480aa58d159f7874bf3b388b7ea836debc23ceb1 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 7 Jun 2023 19:25:09 +0300 Subject: SL-19686 don't build inventory root views on init by default --- indra/newview/llpanelmaininventory.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a28bc33f15..de777fdc1a 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -484,10 +484,10 @@ void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_sele LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); if (main_inventory) { + main_inventory->initSingleFolderRoot(folder_id); main_inventory->toggleViewMode(); if(folder_id.notNull()) { - main_inventory->setSingleFolderViewRoot(folder_id); if(item_to_select.notNull()) { main_inventory->setGallerySelection(item_to_select, true); @@ -1518,6 +1518,11 @@ void LLPanelMainInventory::setActivePanel() mViewModeBtn->setEnabled(mSingleFolderMode || (getAllItemsPanel() == getActivePanel())); } +void LLPanelMainInventory::initSingleFolderRoot(const LLUUID& start_folder_id) +{ + mCombinationInventoryPanel->initFolderRoot(start_folder_id); +} + void LLPanelMainInventory::toggleViewMode() { if(mSingleFolderMode && isCombinationViewMode()) @@ -1586,6 +1591,7 @@ void LLPanelMainInventory::onViewModeClick() } } } + mCombinationInventoryPanel->initFolderRoot(new_root_folder); } toggleViewMode(); -- cgit v1.2.3 From 417dbeb68ef842a8eee22ebab35c89ddee653619 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 10 Jun 2023 01:33:43 +0300 Subject: SL-19823 Edit not always active #5 --- indra/newview/llpanelmaininventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index de777fdc1a..e133bd37a1 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2425,7 +2425,7 @@ void LLPanelMainInventory::updateCombinationVisibility() } } - if (mCombInvUUIDNeedsRename.notNull()) + if (mCombInvUUIDNeedsRename.notNull() && mCombinationInventoryPanel->areViewsInitialized()) { mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, TRUE); mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection(); -- cgit v1.2.3 From bc67a7445cf8113708d94c5759a3509361a23e78 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 12 Jun 2023 23:00:34 +0300 Subject: SL-19823 Fix active panel not existing --- indra/newview/llpanelmaininventory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index e133bd37a1..7259ecf788 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1503,9 +1503,10 @@ void LLPanelMainInventory::onAddButtonClick() void LLPanelMainInventory::setActivePanel() { + // Todo: should cover gallery mode in some way if(mSingleFolderMode && isListViewMode()) { - mActivePanel = getChild("single_folder_inv"); + mActivePanel = getChild("comb_single_folder_inv"); } else if(mSingleFolderMode && isCombinationViewMode()) { -- cgit v1.2.3 From 546c6a09d8ddcd8a327dd9dc76e122f6d98effb9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 12 Jun 2023 23:08:12 +0300 Subject: SL-19823 Fix list view not focusing properly --- indra/newview/llpanelmaininventory.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 7259ecf788..713ae21198 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2425,14 +2425,17 @@ void LLPanelMainInventory::updateCombinationVisibility() mCombinationListLayoutPanel->setShape(list_latout, true /*tell stack to account for new shape*/); } } + } - if (mCombInvUUIDNeedsRename.notNull() && mCombinationInventoryPanel->areViewsInitialized()) - { - mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, TRUE); - mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection(); - mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(TRUE); - mCombInvUUIDNeedsRename.setNull(); - } + if (mSingleFolderMode + && !isGalleryViewMode() + && mCombInvUUIDNeedsRename.notNull() + && mCombinationInventoryPanel->areViewsInitialized()) + { + mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, TRUE); + mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection(); + mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(TRUE); + mCombInvUUIDNeedsRename.setNull(); } } -- cgit v1.2.3 From 7f6ad82a2a76ed1f96bf1ca61cacc51151fe74bf Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 12 Jun 2023 23:19:02 +0300 Subject: SL-19823 Additional logging --- indra/newview/llpanelmaininventory.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 713ae21198..05816f5f37 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -199,7 +199,7 @@ BOOL LLPanelMainInventory::postBuild() } // Now load the stored settings from disk, if available. std::string filterSaveName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME)); - LL_INFOS() << "LLPanelMainInventory::init: reading from " << filterSaveName << LL_ENDL; + LL_INFOS("Inventory") << "LLPanelMainInventory::init: reading from " << filterSaveName << LL_ENDL; llifstream file(filterSaveName.c_str()); LLSD savedFilterState; if (file.is_open()) @@ -510,8 +510,6 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) { if(isCombinationViewMode()) { - //show layout and inventory panel before adding the item - //to avoid wrong position of the 'renamer' mForceShowInvLayout = true; } @@ -524,6 +522,13 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) { // might need to refresh visibility, delay rename panel->mCombInvUUIDNeedsRename = new_id; + + if (panel->isCombinationViewMode()) + { + panel->mForceShowInvLayout = true; + } + + LL_DEBUGS("Inventory") << "Done creating inventory: " << new_id << LL_ENDL; } }; menu_create_inventory_item(NULL, getCurrentSFVRoot(), userdata, LLUUID::null, callback_created); @@ -541,6 +546,7 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata) if (panel) { panel->setGallerySelection(new_id); + LL_DEBUGS("Inventory") << "Done creating inventory: " << new_id << LL_ENDL; } } }; -- cgit v1.2.3 From 71534d8fa7083355271eba69a7b6045f0c34463f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 14 Jun 2023 02:03:38 +0300 Subject: SL-19686 WIP Switching single folder view for large inventories causes stalls --- indra/newview/llpanelmaininventory.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 05816f5f37..eb0ed52317 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1530,6 +1530,16 @@ void LLPanelMainInventory::initSingleFolderRoot(const LLUUID& start_folder_id) mCombinationInventoryPanel->initFolderRoot(start_folder_id); } +void LLPanelMainInventory::initInventoryViews() +{ + LLInventoryPanel* all_item = getChild(ALL_ITEMS); + all_item->initializeViewBuilding(); + LLInventoryPanel* recent_item = getChild(RECENT_ITEMS); + recent_item->initializeViewBuilding(); + LLInventoryPanel* worn_item = getChild(WORN_ITEMS); + worn_item->initializeViewBuilding(); +} + void LLPanelMainInventory::toggleViewMode() { if(mSingleFolderMode && isCombinationViewMode()) -- cgit v1.2.3 From 143e103bcf2b9be2b249ce96e7f84a52469174c7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 14 Jun 2023 23:59:43 +0300 Subject: SL-19686 WIP Switching single folder view for large inventories causes stalls #2 --- indra/newview/llpanelmaininventory.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index eb0ed52317..a785d5adb7 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2350,6 +2350,7 @@ void LLPanelMainInventory::updatePanelVisibility() // visibility will be controled by updateCombinationVisibility() mCombinationGalleryLayoutPanel->setVisible(true); + mCombinationGalleryPanel->setVisible(true); mCombinationListLayoutPanel->setVisible(true); } else @@ -2363,12 +2364,14 @@ void LLPanelMainInventory::updatePanelVisibility() comb_gallery_filter.markDefault(); mCombinationGalleryLayoutPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); + mCombinationGalleryPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); // to prevent or process updates mCombinationListLayoutPanel->setVisible(mSingleFolderMode && isListViewMode()); } } else { mCombinationGalleryLayoutPanel->setVisible(false); + mCombinationGalleryPanel->setVisible(false); // to prevent updates mCombinationListLayoutPanel->setVisible(false); } } @@ -2380,6 +2383,7 @@ void LLPanelMainInventory::updateCombinationVisibility() bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout; mCombinationGalleryLayoutPanel->setVisible(!is_gallery_empty); + mCombinationGalleryPanel->setVisible(true); // to make sure root updates are getting processed mCombinationListLayoutPanel->setVisible(show_inv_pane); mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane); if(mCombinationInventoryPanel->hasVisibleItems()) -- cgit v1.2.3 From 872e23e305c9b5bf1343ea52d801fa662737ceb8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 15 Jun 2023 17:09:35 +0300 Subject: SL-19686 WIP Fix new inventory window not initing --- indra/newview/llpanelmaininventory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index a785d5adb7..3226cb51a4 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -441,7 +441,10 @@ LLFloaterSidePanelContainer* LLPanelMainInventory::newWindow() if (!gAgentCamera.cameraMouselook()) { - return LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); + LLFloaterSidePanelContainer* floater = LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); + LLSidepanelInventory* sidepanel_inventory = floater->findChild("main_panel"); + sidepanel_inventory->initInventoryViews(); + return floater; } return NULL; } -- cgit v1.2.3 From d077558ed7fac01aae8d5a1670f4d0764ec6fbcb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 15 Jun 2023 22:50:41 +0300 Subject: SL-19686 Fix memory leak --- indra/newview/llpanelmaininventory.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 3226cb51a4..107a00f35a 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2386,7 +2386,6 @@ void LLPanelMainInventory::updateCombinationVisibility() bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout; mCombinationGalleryLayoutPanel->setVisible(!is_gallery_empty); - mCombinationGalleryPanel->setVisible(true); // to make sure root updates are getting processed mCombinationListLayoutPanel->setVisible(show_inv_pane); mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane); if(mCombinationInventoryPanel->hasVisibleItems()) @@ -2402,7 +2401,7 @@ void LLPanelMainInventory::updateCombinationVisibility() if (mReshapeInvLayout && show_inv_pane - && mCombinationGalleryPanel->hasVisibleItems() + && (mCombinationGalleryPanel->hasVisibleItems() || mCombinationGalleryPanel->areViewsInitialized()) && mCombinationInventoryPanel->areViewsInitialized()) { mReshapeInvLayout = false; -- cgit v1.2.3 From 93ab02b672efc5388230629bafb5519e725a3683 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Mon, 19 Jun 2023 23:03:06 +0300 Subject: SL-19885 add sorting by date for Gallery view --- indra/newview/llpanelmaininventory.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 107a00f35a..30364e06eb 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -265,6 +265,7 @@ BOOL LLPanelMainInventory::postBuild() mListViewRootUpdatedConnection = mCombinationInventoryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false)); mCombinationGalleryPanel = getChild("comb_gallery_view_inv"); + mCombinationGalleryPanel->setSortOrder(mCombinationInventoryPanel->getSortOrder()); LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter(); comb_gallery_filter.setFilterThumbnails(LLInventoryFilter::FILTER_ONLY_THUMBNAILS); comb_gallery_filter.markDefault(); @@ -631,6 +632,10 @@ void LLPanelMainInventory::setSortBy(const LLSD& userdata) sort_order_mask |= LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP; } } + if(mSingleFolderMode && !isListViewMode()) + { + mCombinationGalleryPanel->setSortOrder(sort_order_mask, true); + } getActivePanel()->setSortOrder(sort_order_mask); if (isRecentItemsPanelSelected()) @@ -2150,7 +2155,7 @@ bool LLPanelMainInventory::isActionVisible(const LLSD& userdata) BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) { - U32 sort_order_mask = getActivePanel()->getSortOrder(); + U32 sort_order_mask = (mSingleFolderMode && isGalleryViewMode()) ? mCombinationGalleryPanel->getSortOrder() : getActivePanel()->getSortOrder(); const std::string command_name = userdata.asString(); if (command_name == "sort_by_name") { @@ -2500,20 +2505,24 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) { std::list forward_history; std::list backward_history; + U32 sort_order; switch(mViewMode) { case MODE_LIST: forward_history = mCombinationInventoryPanel->getNavForwardList(); backward_history = mCombinationInventoryPanel->getNavBackwardList(); + sort_order = mCombinationInventoryPanel->getSortOrder(); break; case MODE_GALLERY: forward_history = mCombinationGalleryPanel->getNavForwardList(); backward_history = mCombinationGalleryPanel->getNavBackwardList(); + sort_order = mCombinationGalleryPanel->getSortOrder(); break; case MODE_COMBINATION: forward_history = mCombinationInventoryPanel->getNavForwardList(); backward_history = mCombinationInventoryPanel->getNavBackwardList(); mCombinationInventoryPanel->getRootFolder()->setForceArrange(false); + sort_order = mCombinationInventoryPanel->getSortOrder(); break; } @@ -2527,12 +2536,14 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) mCombinationInventoryPanel->changeFolderRoot(cur_root); mCombinationInventoryPanel->setNavForwardList(forward_history); mCombinationInventoryPanel->setNavBackwardList(backward_history); + mCombinationInventoryPanel->setSortOrder(sort_order); } if(isGalleryViewMode()) { mCombinationGalleryPanel->setRootFolder(cur_root); mCombinationGalleryPanel->setNavForwardList(forward_history); mCombinationGalleryPanel->setNavBackwardList(backward_history); + mCombinationGalleryPanel->setSortOrder(sort_order, true); } if(isCombinationViewMode()) { @@ -2542,6 +2553,8 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) mCombinationInventoryPanel->setNavBackwardList(backward_history); mCombinationGalleryPanel->setNavForwardList(forward_history); mCombinationGalleryPanel->setNavBackwardList(backward_history); + mCombinationInventoryPanel->setSortOrder(sort_order); + mCombinationGalleryPanel->setSortOrder(sort_order, true); } updateNavButtons(); -- cgit v1.2.3 From 2a035c080dec2aa16b9628aac7b120e4f15135c2 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 16 Jun 2023 08:42:23 +0200 Subject: SL-18977 Borders of inventory view in inventory floater seem to be cut a bit --- indra/newview/llpanelmaininventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 30364e06eb..5ae61f0c36 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2505,7 +2505,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode) { std::list forward_history; std::list backward_history; - U32 sort_order; + U32 sort_order = 0; switch(mViewMode) { case MODE_LIST: -- cgit v1.2.3 From 65fe37a93029e17f45e488619a5e589a2983757f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 24 Jun 2023 01:49:27 +0300 Subject: SL-19604 Fix gallery view having huge ident at the bottom --- indra/newview/llpanelmaininventory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5ae61f0c36..27c8f10889 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -256,6 +256,7 @@ BOOL LLPanelMainInventory::postBuild() mCombinationViewPanel = getChild("combination_view_inventory"); mCombinationGalleryLayoutPanel = getChild("comb_gallery_layout"); mCombinationListLayoutPanel = getChild("comb_inventory_layout"); + mCombinationLayoutStack = getChild("combination_view_stack"); mCombinationInventoryPanel = getChild("comb_single_folder_inv"); LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); @@ -2371,6 +2372,7 @@ void LLPanelMainInventory::updatePanelVisibility() comb_gallery_filter.setFilterThumbnails(LLInventoryFilter::FILTER_INCLUDE_THUMBNAILS); comb_gallery_filter.markDefault(); + mCombinationLayoutStack->setPanelSpacing(0); mCombinationGalleryLayoutPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); mCombinationGalleryPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); // to prevent or process updates mCombinationListLayoutPanel->setVisible(mSingleFolderMode && isListViewMode()); @@ -2390,6 +2392,10 @@ void LLPanelMainInventory::updateCombinationVisibility() { bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout; + + const S32 DRAG_HANDLE_PADDING = 12; // for drag handle to not overlap gallery when both inventories are visible + mCombinationLayoutStack->setPanelSpacing(show_inv_pane ? DRAG_HANDLE_PADDING : 0); + mCombinationGalleryLayoutPanel->setVisible(!is_gallery_empty); mCombinationListLayoutPanel->setVisible(show_inv_pane); mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane); -- cgit v1.2.3 From bbcedf9c847f1f768e6c34e74a6a4373b0e7ae24 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 1 Jul 2023 00:20:01 +0300 Subject: SL-19914 Inventory gallery Tab support #2 --- indra/newview/llpanelmaininventory.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 27c8f10889..b63d6b9308 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -2322,20 +2322,11 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked) void LLPanelMainInventory::onCombinationGallerySelectionChanged(const LLUUID& category_id) { - if(category_id != LLUUID::null) - { - mCombinationInventoryPanel->unSelectAll(); - } } void LLPanelMainInventory::onCombinationInventorySelectionChanged(const std::deque& items, BOOL user_action) { onSelectionChange(mCombinationInventoryPanel, items, user_action); - - if(!items.empty()) - { - mCombinationGalleryPanel->clearSelection(); - } } void LLPanelMainInventory::updatePanelVisibility() -- cgit v1.2.3 From 4fb9a3f469c2cb0197d686acb68827f0fa32b451 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 20 Jul 2023 23:47:05 +0300 Subject: SL-20040 Fix selection and context menu issues --- indra/newview/llpanelmaininventory.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview/llpanelmaininventory.cpp') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index b63d6b9308..30f301027c 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1750,7 +1750,7 @@ void LLPanelMainInventory::saveTexture(const LLSD& userdata) LLUUID item_id; if(mSingleFolderMode && isGalleryViewMode()) { - item_id = mCombinationGalleryPanel->getSelectedItemID(); + item_id = mCombinationGalleryPanel->getFirstSelectedItemID(); if (item_id.isNull()) return; } else @@ -1848,7 +1848,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) { if(mSingleFolderMode && isGalleryViewMode()) { - LLInventoryObject *obj = gInventory.getObject(mCombinationGalleryPanel->getSelectedItemID()); + LLInventoryObject *obj = gInventory.getObject(mCombinationGalleryPanel->getFirstSelectedItemID()); if (obj && obj->getIsLinkType()) { show_item_original(obj->getUUID()); @@ -1878,7 +1878,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); if (main_inventory) { - LLInventoryObject *obj = gInventory.getObject(mCombinationGalleryPanel->getSelectedItemID()); + LLInventoryObject *obj = gInventory.getObject(mCombinationGalleryPanel->getFirstSelectedItemID()); if (obj) { main_inventory->findLinks(obj->getUUID(), obj->getName()); @@ -1905,7 +1905,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) LLSD params; if(mSingleFolderMode && isGalleryViewMode()) { - params = LLSD(mCombinationGalleryPanel->getSelectedItemID()); + params = LLSD(mCombinationGalleryPanel->getFirstSelectedItemID()); } else { @@ -1965,7 +1965,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) { if(mSingleFolderMode && isGalleryViewMode()) { - std::set uuids{ mCombinationGalleryPanel->getSelectedItemID()}; + std::set uuids{ mCombinationGalleryPanel->getFirstSelectedItemID()}; LLAvatarActions::shareWithAvatars(uuids, gFloaterView->getParentFloater(this)); } else @@ -2009,7 +2009,7 @@ bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata) LLViewerInventoryItem *inv_item = NULL; if(mSingleFolderMode && isGalleryViewMode()) { - inv_item = gInventory.getItem(mCombinationGalleryPanel->getSelectedItemID()); + inv_item = gInventory.getItem(mCombinationGalleryPanel->getFirstSelectedItemID()); } else { @@ -2059,7 +2059,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) LLUUID item_id; if(mSingleFolderMode && isGalleryViewMode()) { - item_id = mCombinationGalleryPanel->getSelectedItemID(); + item_id = mCombinationGalleryPanel->getFirstSelectedItemID(); } else{ LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); @@ -2079,7 +2079,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) LLUUID item_id; if(mSingleFolderMode && isGalleryViewMode()) { - item_id = mCombinationGalleryPanel->getSelectedItemID(); + item_id = mCombinationGalleryPanel->getFirstSelectedItemID(); } else{ LLFolderView* root = getActivePanel()->getRootFolder(); @@ -2114,7 +2114,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) { if(mSingleFolderMode && isGalleryViewMode()) { - return can_share_item(mCombinationGalleryPanel->getSelectedItemID()); + return can_share_item(mCombinationGalleryPanel->getFirstSelectedItemID()); } else{ LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); @@ -2626,7 +2626,7 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id, bool new_w void LLPanelMainInventory::scrollToGallerySelection() { - mCombinationGalleryPanel->scrollToShowItem(mCombinationGalleryPanel->getSelectedItemID()); + mCombinationGalleryPanel->scrollToShowItem(mCombinationGalleryPanel->getFirstSelectedItemID()); } void LLPanelMainInventory::scrollToInvPanelSelection() -- cgit v1.2.3