From db45317cae8cfa700f9003541f948afc9e238303 Mon Sep 17 00:00:00 2001 From: "leslie@leslie-HPz600.lindenlab.com" Date: Fri, 5 Aug 2011 11:12:27 -0700 Subject: EXP-863 FIX -- Add Outbox sync button that performs marketplace sync EXP-908 FIX -- Hide outbox when appropriate EXP-1035 FIX -- Allow user to remove items from outbox EXP-1000 FIX -- New icon can cover long names in Received Items Panel EXP-1001 FIX -- Newness is removed on next login if you log out or crash before opening inventory panel EXP-1008 UPDATE -- Extra space at bottom of Inventory panel when Inbox/outbox not displayed * Updated "New" tag to properly display over long names per Epic's design * "New" tags now compare vs last inbox collapse time rather than expansion time * Marketplace inventory panels now have their own layout stack Reviewed by Leyla --- .../newview/app_settings/settings_per_account.xml | 4 +- indra/newview/llpanelmarketplaceinbox.cpp | 4 +- indra/newview/llpanelmarketplaceinboxinventory.cpp | 4 +- indra/newview/llpanelmarketplaceoutbox.cpp | 2 + indra/newview/llsidepanelinventory.cpp | 96 +++++++++++++++------ indra/newview/llsidepanelinventory.h | 4 + indra/newview/skins/default/colors.xml | 5 +- indra/newview/skins/default/textures/textures.xml | 5 +- .../textures/widgets/Badge_Background_New.png | Bin 1369 -> 0 bytes .../textures/widgets/New_Tag_Background.png | Bin 0 -> 957 bytes .../default/textures/widgets/New_Tag_Border.png | Bin 0 -> 969 bytes .../skins/default/xui/en/sidepanel_inventory.xml | 33 ++++++- .../xui/en/widgets/inbox_folder_view_folder.xml | 12 +-- 13 files changed, 126 insertions(+), 43 deletions(-) delete mode 100644 indra/newview/skins/default/textures/widgets/Badge_Background_New.png create mode 100644 indra/newview/skins/default/textures/widgets/New_Tag_Background.png create mode 100644 indra/newview/skins/default/textures/widgets/New_Tag_Border.png (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 1142f01232..9064d6894d 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -33,10 +33,10 @@ Value - LastInventoryInboxExpand + LastInventoryInboxCollapse Comment - The last time the received items inbox was expanded. + The last time the received items inbox was collapsed. Persist 1 Type diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index c505ad85a3..6a3f8afa29 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -55,7 +55,7 @@ LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() { if (getChild("inbox_btn")->getToggleState()) { - gSavedPerAccountSettings.setString("LastInventoryInboxExpand", LLDate::now().asString()); + gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); } } @@ -92,6 +92,8 @@ void LLPanelMarketplaceInbox::setupInventoryPanel() LLUICtrlFactory::createFromFile("panel_inbox_inventory.xml", inbox_inventory_parent, LLInventoryPanel::child_registry_t::instance()); + + llassert(mInventoryPanel); // Reshape the inventory to the proper size LLRect inventory_placeholder_rect = inbox_inventory_placeholder->getRect(); diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 2c97d539a1..de4e4414c4 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -66,7 +66,7 @@ void LLInboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& para LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false); - // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type + // leslie -- temporary HACK to work around sim not creating inbox with proper system folder type if (root_id.isNull()) { std::string start_folder_name(params.start_folder()); @@ -182,7 +182,7 @@ void LLInboxFolderViewFolder::draw() void LLInboxFolderViewFolder::updateFlag() const { - LLDate saved_freshness_date = LLDate(gSavedPerAccountSettings.getString("LastInventoryInboxExpand")); + LLDate saved_freshness_date = LLDate(gSavedPerAccountSettings.getString("LastInventoryInboxCollapse")); mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch()); } diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 90c7f9728b..d2f1282c8f 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -123,6 +123,8 @@ void LLPanelMarketplaceOutbox::setupInventoryPanel() LLUICtrlFactory::createFromFile("panel_outbox_inventory.xml", outbox_inventory_parent, LLInventoryPanel::child_registry_t::instance()); + + llassert(mInventoryPanel); // Reshape the inventory to the proper size LLRect inventory_placeholder_rect = outbox_inventory_placeholder->getRect(); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 41a0b57f2d..809fd0b2fa 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -66,11 +66,14 @@ static const char * const OUTBOX_BUTTON_NAME = "outbox_btn"; static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; static const char * const OUTBOX_LAYOUT_PANEL_NAME = "outbox_layout_panel"; + +static const char * const INBOX_OUTBOX_LAYOUT_PANEL_NAME = "inbox_outbox_layout_panel"; static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel"; static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox"; static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox"; +static const char * const INBOX_OUTBOX_LAYOUT_STACK_NAME = "inbox_outbox_layout_stack"; static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; @@ -233,16 +236,20 @@ BOOL LLSidepanelInventory::postBuild() // Marketplace inbox/outbox setup { - LLLayoutStack* stack = getChild(INVENTORY_LAYOUT_STACK_NAME); + LLLayoutStack* inv_stack = getChild(INVENTORY_LAYOUT_STACK_NAME); // Disable user_resize on main inventory panel by default - stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false); - stack->setPanelUserResize(INBOX_LAYOUT_PANEL_NAME, false); - stack->setPanelUserResize(OUTBOX_LAYOUT_PANEL_NAME, false); + inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false); + inv_stack->setPanelUserResize(INBOX_OUTBOX_LAYOUT_PANEL_NAME, false); + + // Collapse marketplace panel by default + inv_stack->collapsePanel(getChild(INBOX_OUTBOX_LAYOUT_PANEL_NAME), true); + + LLLayoutStack* inout_stack = getChild(INBOX_OUTBOX_LAYOUT_STACK_NAME); // Collapse both inbox and outbox panels - stack->collapsePanel(getChild(INBOX_LAYOUT_PANEL_NAME), true); - stack->collapsePanel(getChild(OUTBOX_LAYOUT_PANEL_NAME), true); + inout_stack->collapsePanel(getChild(INBOX_LAYOUT_PANEL_NAME), true); + inout_stack->collapsePanel(getChild(OUTBOX_LAYOUT_PANEL_NAME), true); // Set up button states and callbacks LLButton * inbox_button = getChild(INBOX_BUTTON_NAME); @@ -386,12 +393,22 @@ void LLSidepanelInventory::enableInbox(bool enabled) { mInboxEnabled = enabled; getChild(INBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); + + if (mInboxEnabled) + { + getChild(INBOX_OUTBOX_LAYOUT_PANEL_NAME)->setVisible(TRUE); + } } void LLSidepanelInventory::enableOutbox(bool enabled) { mOutboxEnabled = enabled; getChild(OUTBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); + + if (mOutboxEnabled) + { + getChild(INBOX_OUTBOX_LAYOUT_PANEL_NAME)->setVisible(TRUE); + } } void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) @@ -410,65 +427,88 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) void LLSidepanelInventory::onOutboxChanged(const LLUUID& outbox_id) { - // Perhaps use this to track outbox changes? + // Expand the outbox since we have new items in it + LLPanelMarketplaceInbox * outbox = findChild(MARKETPLACE_OUTBOX_PANEL); + if (outbox) + { + getChild(OUTBOX_BUTTON_NAME)->setToggleState(true); + onToggleOutboxBtn(); + } } -bool manageInboxOutboxPanels(LLLayoutStack * stack, - LLButton * pressedButton, LLLayoutPanel * pressedPanel, - LLButton * otherButton, LLLayoutPanel * otherPanel) +bool LLSidepanelInventory::manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel, + LLButton * otherButton, LLLayoutPanel * otherPanel) { bool expand = pressedButton->getToggleState(); bool otherExpanded = otherButton->getToggleState(); - // - // NOTE: Ideally we could have two panel sizes stored for a collapsed and expanded minimum size. - // For now, leave this code disabled because it creates some bad artifacts when expanding - // and collapsing the inbox/outbox. - // - //S32 smallMinSize = (expand ? pressedPanel->getMinDim() : otherPanel->getMinDim()); - //S32 pressedMinSize = (expand ? 2 * smallMinSize : smallMinSize); - //otherPanel->setMinDim(smallMinSize); - //pressedPanel->setMinDim(pressedMinSize); + LLLayoutStack* inv_stack = getChild(INVENTORY_LAYOUT_STACK_NAME); + LLLayoutStack* inout_stack = getChild(INBOX_OUTBOX_LAYOUT_STACK_NAME); + LLLayoutPanel* inout_panel = getChild(INBOX_OUTBOX_LAYOUT_PANEL_NAME); + // Enable user_resize on main inventory panel only when a marketplace box is expanded + inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, expand); + inv_stack->collapsePanel(inout_panel, !expand); + + // Collapse other marketplace panel if it is expanded if (expand && otherExpanded) { // Reshape pressedPanel to the otherPanel's height so we preserve the marketplace panel size pressedPanel->reshape(pressedPanel->getRect().getWidth(), otherPanel->getRect().getHeight()); - stack->collapsePanel(otherPanel, true); + inout_stack->collapsePanel(otherPanel, true); otherButton->setToggleState(false); } + else + { + // NOTE: This is an attempt to reshape the inventory panel to the proper size but it doesn't seem to propagate + // propery to the child panels. - stack->collapsePanel(pressedPanel, !expand); + S32 new_height = inout_panel->getRect().getHeight(); - // Enable user_resize on main inventory panel only when a marketplace box is expanded - stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, expand); + if (otherPanel->getVisible()) + { + new_height -= otherPanel->getMinDim(); + } + + pressedPanel->reshape(pressedPanel->getRect().getWidth(), new_height); + } + + // Expand/collapse the indicated panel + inout_stack->collapsePanel(pressedPanel, !expand); return expand; } void LLSidepanelInventory::onToggleInboxBtn() { - LLLayoutStack* stack = getChild(INVENTORY_LAYOUT_STACK_NAME); LLButton* pressedButton = getChild(INBOX_BUTTON_NAME); LLLayoutPanel* pressedPanel = getChild(INBOX_LAYOUT_PANEL_NAME); LLButton* otherButton = getChild(OUTBOX_BUTTON_NAME); LLLayoutPanel* otherPanel = getChild(OUTBOX_LAYOUT_PANEL_NAME); - manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); + bool inbox_expanded = manageInboxOutboxPanels(pressedButton, pressedPanel, otherButton, otherPanel); - gSavedPerAccountSettings.setString("LastInventoryInboxExpand", LLDate::now().asString()); + if (!inbox_expanded) + { + gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); + } } void LLSidepanelInventory::onToggleOutboxBtn() { - LLLayoutStack* stack = getChild(INVENTORY_LAYOUT_STACK_NAME); LLButton* pressedButton = getChild(OUTBOX_BUTTON_NAME); LLLayoutPanel* pressedPanel = getChild(OUTBOX_LAYOUT_PANEL_NAME); LLButton* otherButton = getChild(INBOX_BUTTON_NAME); LLLayoutPanel* otherPanel = getChild(INBOX_LAYOUT_PANEL_NAME); - manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); + bool inbox_was_expanded = otherButton->getToggleState(); + manageInboxOutboxPanels(pressedButton, pressedPanel, otherButton, otherPanel); + + if (inbox_was_expanded) + { + gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString()); + } } void LLSidepanelInventory::onOpen(const LLSD& key) diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 9117e3bf27..d00cd05d54 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -29,11 +29,13 @@ #include "llpanel.h" +class LLButton; class LLFolderViewItem; class LLInboxOutboxAddedObserver; class LLInventoryCategoriesObserver; class LLInventoryItem; class LLInventoryPanel; +class LLLayoutPanel; class LLPanelMainInventory; class LLSidepanelItemInfo; class LLSidepanelTaskInfo; @@ -90,6 +92,8 @@ protected: void onInboxChanged(const LLUUID& inbox_id); void onOutboxChanged(const LLUUID& outbox_id); + bool manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel, LLButton * otherButton, LLLayoutPanel * otherPanel); + // // UI Elements // diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 31b6fc77f5..6144c761b7 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -32,6 +32,9 @@ + @@ -197,7 +200,7 @@ reference="Black" /> + reference="Gray" /> diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 799cd907dc..392a6309c3 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -72,7 +72,10 @@ with the same filename but different name - + + + + diff --git a/indra/newview/skins/default/textures/widgets/Badge_Background_New.png b/indra/newview/skins/default/textures/widgets/Badge_Background_New.png deleted file mode 100644 index 9f114f2e4a..0000000000 Binary files a/indra/newview/skins/default/textures/widgets/Badge_Background_New.png and /dev/null differ diff --git a/indra/newview/skins/default/textures/widgets/New_Tag_Background.png b/indra/newview/skins/default/textures/widgets/New_Tag_Background.png new file mode 100644 index 0000000000..cd639dd80f Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/New_Tag_Background.png differ diff --git a/indra/newview/skins/default/textures/widgets/New_Tag_Border.png b/indra/newview/skins/default/textures/widgets/New_Tag_Border.png new file mode 100644 index 0000000000..56df0d0127 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/New_Tag_Border.png differ diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 1d1d4ca01e..24ece37f3c 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -30,6 +30,7 @@ width="330"> - + + Received Items