diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-02-21 14:44:45 +0200 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-02-21 14:44:45 +0200 |
commit | d6f1ba31da4a40d62fe781419cdd7db9843f6a30 (patch) | |
tree | 5a8f7c1c359e9327355768a739dfb0389f40508f /indra | |
parent | 6786e43fcb315eb10b5ab4a205163fb424c18bc6 (diff) |
SL-19105 Updated icons, menus and Received items panel visibility in single-folder mode
Diffstat (limited to 'indra')
14 files changed, 160 insertions, 44 deletions
diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp index 4d76194b48..2187fda7c7 100644 --- a/indra/newview/llfloaterchangeitemthumbnail.cpp +++ b/indra/newview/llfloaterchangeitemthumbnail.cpp @@ -55,7 +55,6 @@ public: void notify(const std::vector<std::string>& filenames) override; private: - LLHandle<LLFloater> *mHandle; LLUUID mInventoryId; LLUUID mTaskId; }; 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<LLInventoryPanel>("single_folder_inv") : (LLInventoryPanel*)getChild<LLTabContainer>("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<LLFolderViewItem*> 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<LLFolderViewModelItemInventory*>(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<LLFolderViewItem*> 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<LLFolderViewModelItemInventory*>(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<LLFloaterSidePanelContainer*>(gFloaterView->getParentFloater(this)); + if(inventory_container) + { + return dynamic_cast<LLSidepanelInventory*>(inventory_container->findChild<LLPanel>("main_panel", true)); + } + return NULL; +} // List Commands // //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 923ebba98b..e5262540cf 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -44,6 +44,7 @@ class LLTabContainer; class LLFloaterInventoryFinder; class LLMenuButton; class LLMenuGL; +class LLSidepanelInventory; class LLToggleableMenu; class LLFloater; @@ -103,6 +104,7 @@ public: void onBackFolderClicked(); void onForwardFolderClicked(); void setSingleFolderViewRoot(const LLUUID& folder_id); + bool isSingleFolderMode() { return mSingleFolderMode; } protected: // @@ -137,6 +139,8 @@ protected: void onSelectSearchType(); void updateSearchTypeCombo(); + LLSidepanelInventory* getParentSidepanelInventory(); + private: LLFloaterInventoryFinder* getFinder(); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 9f2003bbb2..3a0302e531 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -119,16 +119,15 @@ LLSidepanelInventory::LLSidepanelInventory() , mInboxEnabled(false) , mCategoriesObserver(NULL) , mInboxAddedObserver(NULL) + , mInboxLayoutPanel(NULL) { //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() } LLSidepanelInventory::~LLSidepanelInventory() { - LLLayoutPanel* inbox_layout_panel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); - // Save the InventoryMainPanelHeight in settings per account - gSavedPerAccountSettings.setS32("InventoryInboxHeight", inbox_layout_panel->getTargetDim()); + gSavedPerAccountSettings.setS32("InventoryInboxHeight", mInboxLayoutPanel->getTargetDim()); if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) { @@ -187,11 +186,11 @@ BOOL LLSidepanelInventory::postBuild() bool is_inbox_collapsed = !inbox_button->getToggleState(); // Restore the collapsed inbox panel state - LLLayoutPanel* inbox_panel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); - inv_stack->collapsePanel(inbox_panel, is_inbox_collapsed); + mInboxLayoutPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); + inv_stack->collapsePanel(mInboxLayoutPanel, is_inbox_collapsed); if (!is_inbox_collapsed) { - inbox_panel->setTargetDim(gSavedPerAccountSettings.getS32("InventoryInboxHeight")); + mInboxLayoutPanel->setTargetDim(gSavedPerAccountSettings.getS32("InventoryInboxHeight")); } // Set the inbox visible based on debug settings (final setting comes from http request below) @@ -296,8 +295,20 @@ void LLSidepanelInventory::enableInbox(bool enabled) { mInboxEnabled = enabled; - LLLayoutPanel * inbox_layout_panel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); - inbox_layout_panel->setVisible(enabled); + if(!enabled || !mPanelMainInventory->isSingleFolderMode()) + { + toggleInbox(); + } +} + +void LLSidepanelInventory::hideInbox() +{ + mInboxLayoutPanel->setVisible(false); +} + +void LLSidepanelInventory::toggleInbox() +{ + mInboxLayoutPanel->setVisible(mInboxEnabled); } void LLSidepanelInventory::openInbox() @@ -327,25 +338,24 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) void LLSidepanelInventory::onToggleInboxBtn() { LLButton* inboxButton = getChild<LLButton>(INBOX_BUTTON_NAME); - LLLayoutPanel* inboxPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); LLLayoutStack* inv_stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); const bool inbox_expanded = inboxButton->getToggleState(); // Expand/collapse the indicated panel - inv_stack->collapsePanel(inboxPanel, !inbox_expanded); + inv_stack->collapsePanel(mInboxLayoutPanel, !inbox_expanded); if (inbox_expanded) { - inboxPanel->setTargetDim(gSavedPerAccountSettings.getS32("InventoryInboxHeight")); - if (inboxPanel->isInVisibleChain()) + mInboxLayoutPanel->setTargetDim(gSavedPerAccountSettings.getS32("InventoryInboxHeight")); + if (mInboxLayoutPanel->isInVisibleChain()) { gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); } } else { - gSavedPerAccountSettings.setS32("InventoryInboxHeight", inboxPanel->getTargetDim()); + gSavedPerAccountSettings.setS32("InventoryInboxHeight", mInboxLayoutPanel->getTargetDim()); } } diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index fbbd657f9e..3a252a87c6 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -74,6 +74,8 @@ public: void onToggleInboxBtn(); void enableInbox(bool enabled); + void toggleInbox(); + void hideInbox(); void openInbox(); @@ -101,6 +103,8 @@ private: LLHandle<LLInventoryPanel> mInventoryPanelInbox; LLPanelMainInventory* mPanelMainInventory; + LLLayoutPanel* mInboxLayoutPanel; + protected: void onBackButtonClicked(); diff --git a/indra/newview/skins/default/textures/icons/multi_folder_mode.png b/indra/newview/skins/default/textures/icons/multi_folder_mode.png Binary files differnew file mode 100644 index 0000000000..8cda3efc36 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/multi_folder_mode.png diff --git a/indra/newview/skins/default/textures/icons/single_folder_back.png b/indra/newview/skins/default/textures/icons/single_folder_back.png Binary files differnew file mode 100644 index 0000000000..b614e9ef9b --- /dev/null +++ b/indra/newview/skins/default/textures/icons/single_folder_back.png diff --git a/indra/newview/skins/default/textures/icons/single_folder_forward.png b/indra/newview/skins/default/textures/icons/single_folder_forward.png Binary files differnew file mode 100644 index 0000000000..c7bee3522d --- /dev/null +++ b/indra/newview/skins/default/textures/icons/single_folder_forward.png diff --git a/indra/newview/skins/default/textures/icons/single_folder_mode.png b/indra/newview/skins/default/textures/icons/single_folder_mode.png Binary files differnew file mode 100644 index 0000000000..f70b754123 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/single_folder_mode.png diff --git a/indra/newview/skins/default/textures/icons/single_folder_up.png b/indra/newview/skins/default/textures/icons/single_folder_up.png Binary files differnew file mode 100644 index 0000000000..651b2b1af1 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/single_folder_up.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 1941c388b7..5d9c362e78 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -886,4 +886,10 @@ with the same filename but different name <texture name="System_Notification" file_name="icons/SL_Logo.png" preload="true"/> <texture name="Icon_Attachment_Small" file_name="icons/Icon_Attachment_Small.png" preload="true"/> <texture name="Icon_Attachment_Large" file_name="icons/Icon_Attachment_Large.png" preload="true"/> + + <texture name="Single_Folder_Mode" file_name="icons/single_folder_mode.png" preload="true"/> + <texture name="Multi_Folder_Mode" file_name="icons/multi_folder_mode.png" preload="true"/> + <texture name="Single_Folder_Back" file_name="icons/single_folder_back.png" preload="true"/> + <texture name="Single_Folder_Forward" file_name="icons/single_folder_forward.png" preload="true"/> + <texture name="Single_Folder_Up" file_name="icons/single_folder_up.png" preload="true"/> </textures> diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml index 027dd40d08..e58eaf79a3 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml @@ -13,12 +13,9 @@ <on_click function="Inventory.GearDefault.Custom.Action" parameter="open_in_current_window" /> - <on_enable - function="Inventory.GearDefault.Enable" - parameter="open_folder" /> <on_visible function="Inventory.GearDefault.Visible" - parameter="single_folder_view" /> + parameter="open_folder" /> </menu_item_call> <menu_item_call label="Open in new window" @@ -27,8 +24,8 @@ <on_click function="Inventory.GearDefault.Custom.Action" parameter="open_in_new_window" /> - <on_enable - function="Inventory.GearDefault.Enable" + <on_visible + function="Inventory.GearDefault.Visible" parameter="open_folder" /> </menu_item_call> <menu_item_call @@ -130,8 +127,11 @@ function="Inventory.GearDefault.Custom.Action" parameter="replace_links" /> </menu_item_call> - <menu_item_separator - layout="topleft" /> + <menu_item_separator> + <menu_item_separator.on_visible + function="Inventory.GearDefault.Visible" + parameter="multi_folder_view" /> + </menu_item_separator> <menu_item_call label="Empty Lost and Found" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml index 0fcdb1cda0..b89ff832b9 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml @@ -53,4 +53,60 @@ function="Inventory.GearDefault.Visible" parameter="multi_folder_view" /> </menu_item_check> + <menu_item_separator> + <menu_item_separator.on_visible + function="Inventory.GearDefault.Visible" + parameter="single_folder_view" /> + </menu_item_separator> + <menu_item_check + label="List view" + layout="topleft" + name="list_view"> + <on_click + function="Inventory.GearDefault.Custom.Action" + parameter="list_view" /> + <on_check + function="Inventory.GearDefault.Check" + parameter="list_view" /> + <on_visible + function="Inventory.GearDefault.Visible" + parameter="single_folder_view" /> + </menu_item_check> + <menu_item_check + label="Gallery view" + layout="topleft" + name="gallery_view"> + <on_click + function="Inventory.GearDefault.Custom.Action" + parameter="gallery_view" /> + <on_check + function="Inventory.GearDefault.Check" + parameter="gallery_view" /> + <on_visible + function="Inventory.GearDefault.Visible" + parameter="single_folder_view" /> + </menu_item_check> + <menu_item_check + label="Combination view" + layout="topleft" + name="combination_view"> + <on_click + function="Inventory.GearDefault.Custom.Action" + parameter="combination_view" /> + <on_check + function="Inventory.GearDefault.Check" + parameter="combination_view" /> + <on_visible + function="Inventory.GearDefault.Visible" + parameter="single_folder_view" /> + </menu_item_check> + <menu_item_separator/> + <menu_item_call + label="Inventory settings..." + layout="topleft" + name="inv_settings"> + <on_click + function="Inventory.GearDefault.Custom.Action" + parameter="inv_settings" /> + </menu_item_call> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 606c2175d8..16ad6f60db 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -24,8 +24,8 @@ Fetched [ITEM_COUNT] Items and [CATEGORY_COUNT] Folders [FILTER] </panel.string> <panel.string name="inventory_title">INVENTORY</panel.string> - <panel.string name="default_mode_btn">Command_AboutLand_Icon</panel.string> - <panel.string name="single_folder_mode_btn">Command_Map_Icon</panel.string> + <panel.string name="default_mode_btn">Multi_Folder_Mode</panel.string> + <panel.string name="single_folder_mode_btn">Single_Folder_Mode</panel.string> <text type="string" length="1" @@ -60,9 +60,9 @@ <button follows="top|left" height="23" - image_selected="Arrow_Left" - image_pressed="Arrow_Left" - image_unselected="Arrow_Left" + image_selected="Single_Folder_Back" + image_pressed="Single_Folder_Back" + image_unselected="Single_Folder_Back" scale_image="false" layout="topleft" left="3" @@ -73,9 +73,9 @@ <button follows="top|left" height="23" - image_selected="Arrow_Right" - image_pressed="Arrow_Right" - image_unselected="Arrow_Right" + image_selected="Single_Folder_Forward" + image_pressed="Single_Folder_Forward" + image_unselected="Single_Folder_Forward" scale_image="false" layout="topleft" left_pad="1" @@ -85,9 +85,9 @@ <button follows="top|left" height="23" - image_selected="Arrow_Up" - image_pressed="Arrow_Up" - image_unselected="Arrow_Up" + image_selected="Single_Folder_Up" + image_pressed="Single_Folder_Up" + image_unselected="Single_Folder_Up" scale_image="false" layout="topleft" left_pad="1" @@ -189,7 +189,7 @@ tool_tip="Switch between views" height="23" image_hover_unselected="Toolbar_Middle_Over" - image_overlay="Command_Map_Icon" + image_overlay="Single_Folder_Mode" image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" layout="topleft" |