From 5e9286f523fe704e6d37c460a6a7ff5b74f9cc6d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 16 Mar 2012 16:34:20 -0700 Subject: EXP-1767 FIX (Received Items panel state does not persist between sessions) made received items not auto resizable save/restore received items height on collapse/expand --- indra/newview/app_settings/settings.xml | 11 --------- .../newview/app_settings/settings_per_account.xml | 22 ++++++++++++++++++ indra/newview/llsidepanelinventory.cpp | 26 ++++++++++++++++++---- .../skins/default/xui/en/sidepanel_inventory.xml | 3 ++- 4 files changed, 46 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ee659ee39e..15da381e2f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4303,17 +4303,6 @@ Boolean Value 0 - - InventoryInboxToggleState - - Comment - Stores the open/closed state of inventory Received items panel - Persist - 1 - Type - Boolean - Value - 0 InventoryLinking diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 8cdd8ed838..143126b334 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -33,6 +33,28 @@ Value + InventoryInboxHeight + + Comment + Inventory inbox panel height in Inventory floater. + Persist + 1 + Type + S32 + Value + 200 + + InventoryInboxToggleState + + Comment + Stores the open/closed state of inventory Received Items panel. + Persist + 1 + Type + Boolean + Value + 0 + DisplayDestinationsOnInitialRun Comment diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index c8b67cc9ec..4f9ab318a5 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -78,7 +78,6 @@ static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; // // Helpers // - class LLInboxAddedObserver : public LLInventoryCategoryAddedObserver { public: @@ -130,6 +129,11 @@ LLSidepanelInventory::LLSidepanelInventory() LLSidepanelInventory::~LLSidepanelInventory() { + LLLayoutPanel* inbox_layout_panel = getChild(INBOX_LAYOUT_PANEL_NAME); + + // Save the InventoryMainPanelHeight in settings per account + gSavedPerAccountSettings.setS32("InventoryInboxHeight", inbox_layout_panel->getTargetDim()); + if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) { gInventory.removeObserver(mCategoriesObserver); @@ -226,7 +230,12 @@ BOOL LLSidepanelInventory::postBuild() bool is_inbox_collapsed = !inbox_button->getToggleState(); // Restore the collapsed inbox panel state - inv_stack->collapsePanel(getChild(INBOX_LAYOUT_PANEL_NAME), is_inbox_collapsed); + LLLayoutPanel* inbox_panel = getChild(INBOX_LAYOUT_PANEL_NAME); + inv_stack->collapsePanel(inbox_panel, is_inbox_collapsed); + if (!is_inbox_collapsed) + { + inbox_panel->setTargetDim(gSavedPerAccountSettings.getS32("InventoryInboxHeight")); + } // Set the inbox visible based on debug settings (final setting comes from http request below) enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); @@ -370,10 +379,19 @@ void LLSidepanelInventory::onToggleInboxBtn() // Expand/collapse the indicated panel inv_stack->collapsePanel(inboxPanel, !inbox_expanded); - if (inbox_expanded && inboxPanel->isInVisibleChain()) + if (inbox_expanded) { - gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); + inboxPanel->setTargetDim(gSavedPerAccountSettings.getS32("InventoryInboxHeight")); + if (inboxPanel->isInVisibleChain()) + { + gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); + } } + else + { + gSavedPerAccountSettings.setS32("InventoryInboxHeight", inboxPanel->getTargetDim()); + } + } void LLSidepanelInventory::onOpen(const LLSD& key) diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 29e27cb146..bd6e934703 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -51,7 +51,7 @@