summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelinventory.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-02-21 14:44:45 +0200
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-02-21 14:44:45 +0200
commitd6f1ba31da4a40d62fe781419cdd7db9843f6a30 (patch)
tree5a8f7c1c359e9327355768a739dfb0389f40508f /indra/newview/llsidepanelinventory.cpp
parent6786e43fcb315eb10b5ab4a205163fb424c18bc6 (diff)
SL-19105 Updated icons, menus and Received items panel visibility in single-folder mode
Diffstat (limited to 'indra/newview/llsidepanelinventory.cpp')
-rw-r--r--indra/newview/llsidepanelinventory.cpp36
1 files changed, 23 insertions, 13 deletions
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());
}
}