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
meow-7.2.2
Richard Linden 2012-03-16 16:34:20 -07:00
parent b9521a38f1
commit 5e9286f523
4 changed files with 46 additions and 16 deletions

View File

@ -4303,17 +4303,6 @@
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>InventoryInboxToggleState</key>
<map>
<key>Comment</key>
<string>Stores the open/closed state of inventory Received items panel</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>InventoryLinking</key>
<map>

View File

@ -33,6 +33,28 @@
<key>Value</key>
<string />
</map>
<key>InventoryInboxHeight</key>
<map>
<key>Comment</key>
<string>Inventory inbox panel height in Inventory floater.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>200</integer>
</map>
<key>InventoryInboxToggleState</key>
<map>
<key>Comment</key>
<string>Stores the open/closed state of inventory Received Items panel.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>DisplayDestinationsOnInitialRun</key>
<map>
<key>Comment</key>

View File

@ -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<LLLayoutPanel>(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<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), is_inbox_collapsed);
LLLayoutPanel* inbox_panel = getChild<LLLayoutPanel>(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)

View File

@ -51,7 +51,7 @@
<layout_panel
width="330"
layout="topleft"
auto_resize="true"
auto_resize="false"
user_resize="true"
follows="left|right|top"
name="inbox_layout_panel"
@ -105,6 +105,7 @@
[NUM] new
</text>
<panel
name="inbox_inventory_placeholder_panel"
follows="all"
left="10"
bottom="235"