diff options
author | leslie@leslie-HPz600.lindenlab.com <leslie@leslie-HPz600.lindenlab.com> | 2011-08-05 11:12:27 -0700 |
---|---|---|
committer | leslie@leslie-HPz600.lindenlab.com <leslie@leslie-HPz600.lindenlab.com> | 2011-08-05 11:12:27 -0700 |
commit | db45317cae8cfa700f9003541f948afc9e238303 (patch) | |
tree | 70051e480575775ab9e852761ef9baf42c0d24fe /indra/newview | |
parent | 45bf1debaa805b64ce30e3c0670a2e9f24d43e08 (diff) |
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
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings_per_account.xml | 4 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceinbox.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceinboxinventory.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llpanelmarketplaceoutbox.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llsidepanelinventory.cpp | 96 | ||||
-rw-r--r-- | indra/newview/llsidepanelinventory.h | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/colors.xml | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/textures.xml | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/widgets/Badge_Background_New.png | bin | 1369 -> 0 bytes | |||
-rw-r--r-- | indra/newview/skins/default/textures/widgets/New_Tag_Background.png | bin | 0 -> 957 bytes | |||
-rw-r--r-- | indra/newview/skins/default/textures/widgets/New_Tag_Border.png | bin | 0 -> 969 bytes | |||
-rw-r--r-- | indra/newview/skins/default/xui/en/sidepanel_inventory.xml | 33 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml | 12 |
13 files changed, 126 insertions, 43 deletions
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 @@ <key>Value</key> <string /> </map> - <key>LastInventoryInboxExpand</key> + <key>LastInventoryInboxCollapse</key> <map> <key>Comment</key> - <string>The last time the received items inbox was expanded.</string> + <string>The last time the received items inbox was collapsed.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> 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<LLButton>("inbox_btn")->getToggleState())
{
- gSavedPerAccountSettings.setString("LastInventoryInboxExpand", LLDate::now().asString());
+ gSavedPerAccountSettings.setString("LastInventoryInboxCollapse", LLDate::now().asString());
}
}
@@ -92,6 +92,8 @@ void LLPanelMarketplaceInbox::setupInventoryPanel() LLUICtrlFactory::createFromFile<LLInventoryPanel>("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<LLInventoryPanel>("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<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); + LLLayoutStack* inv_stack = getChild<LLLayoutStack>(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<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME), true); + + LLLayoutStack* inout_stack = getChild<LLLayoutStack>(INBOX_OUTBOX_LAYOUT_STACK_NAME); // Collapse both inbox and outbox panels - stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true); - stack->collapsePanel(getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME), true); + inout_stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true); + inout_stack->collapsePanel(getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME), true); // Set up button states and callbacks LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME); @@ -386,12 +393,22 @@ void LLSidepanelInventory::enableInbox(bool enabled) { mInboxEnabled = enabled; getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); + + if (mInboxEnabled) + { + getChild<LLLayoutPanel>(INBOX_OUTBOX_LAYOUT_PANEL_NAME)->setVisible(TRUE); + } } void LLSidepanelInventory::enableOutbox(bool enabled) { mOutboxEnabled = enabled; getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); + + if (mOutboxEnabled) + { + getChild<LLLayoutPanel>(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<LLPanelMarketplaceInbox>(MARKETPLACE_OUTBOX_PANEL); + if (outbox) + { + getChild<LLButton>(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<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); + LLLayoutStack* inout_stack = getChild<LLLayoutStack>(INBOX_OUTBOX_LAYOUT_STACK_NAME); + LLLayoutPanel* inout_panel = getChild<LLLayoutPanel>(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<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); LLButton* pressedButton = getChild<LLButton>(INBOX_BUTTON_NAME); LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); LLButton* otherButton = getChild<LLButton>(OUTBOX_BUTTON_NAME); LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>(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<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); LLButton* pressedButton = getChild<LLButton>(OUTBOX_BUTTON_NAME); LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME); LLButton* otherButton = getChild<LLButton>(INBOX_BUTTON_NAME); LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>(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 @@ -33,6 +33,9 @@ name="LtGray_50" value="0.75 0.75 0.75 0.50" /> <color + name="Gray" + value="0.5 0.5 0.5 1" /> + <color name="DkGray" value="0.125 0.125 0.125 1" /> <color @@ -197,7 +200,7 @@ reference="Black" /> <color name="ColorPaletteEntry02" - value="0.5 0.5 0.5 1" /> + reference="Gray" /> <color name="ColorPaletteEntry03" value="0.5 0 0 1" /> 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 <texture name="BackButton_Over" file_name="icons/back_arrow_over.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" /> <texture name="BackButton_Press" file_name="icons/back_arrow_press.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" /> - <texture name="Badge_Background" file_name="widgets/Badge_Background.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> + <texture name="New_Tag_Background" file_name="widgets/New_Tag_Background.png" preload="true" scale.left="12" scale.top="2" scale.right="36" scale.bottom="2" /> + <texture name="New_Tag_Border" file_name="widgets/New_Tag_Border.png" preload="true" scale.left="12" scale.top="2" scale.right="36" scale.bottom="2" /> + + <texture name="Badge_Background" file_name="widgets/Badge_Background.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> <texture name="Badge_Border" file_name="widgets/Badge_Border.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> <texture name="Blank" file_name="Blank.png" preload="false" /> diff --git a/indra/newview/skins/default/textures/widgets/Badge_Background_New.png b/indra/newview/skins/default/textures/widgets/Badge_Background_New.png Binary files differdeleted file mode 100644 index 9f114f2e4a..0000000000 --- a/indra/newview/skins/default/textures/widgets/Badge_Background_New.png +++ /dev/null diff --git a/indra/newview/skins/default/textures/widgets/New_Tag_Background.png b/indra/newview/skins/default/textures/widgets/New_Tag_Background.png Binary files differnew file mode 100644 index 0000000000..cd639dd80f --- /dev/null +++ b/indra/newview/skins/default/textures/widgets/New_Tag_Background.png diff --git a/indra/newview/skins/default/textures/widgets/New_Tag_Border.png b/indra/newview/skins/default/textures/widgets/New_Tag_Border.png Binary files differnew file mode 100644 index 0000000000..56df0d0127 --- /dev/null +++ b/indra/newview/skins/default/textures/widgets/New_Tag_Border.png 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"> <layout_panel name="main_inventory_layout_panel" + layout="topleft" min_dim="150" width="330" follows="bottom|left|right" @@ -47,11 +48,33 @@ height="480" width="330" /> </layout_panel> - <layout_panel + <layout_panel width="330" + layout="topleft" auto_resize="true" user_resize="false" follows="bottom|left|right" + name="inbox_outbox_layout_panel" + visible="false" + min_dim="70" + max_dim="235" + expanded_min_dim="125" + height="70"> + <layout_stack + follows="left|right|top|bottom" + layout="topleft" + left="0" + top="0" + orientation="vertical" + name="inbox_outbox_layout_stack" + height="235" + width="330"> + <layout_panel + width="330" + layout="topleft" + auto_resize="true" + user_resize="false" + follows="left|right|top" name="inbox_layout_panel" visible="false" min_dim="35" @@ -72,6 +95,7 @@ <string name="InboxLabelNoArg">Received Items</string> <button label="Received Items" + font="SansSerifMedium" name="inbox_btn" height="35" width="308" @@ -96,7 +120,6 @@ name="inbox_fresh_new_count" font="SansSerifMedium" halign="right" - text_color="EmphasisColor" top_pad="0" width="300"> [NUM] New @@ -130,9 +153,10 @@ </layout_panel> <layout_panel width="330" + layout="topleft" auto_resize="true" user_resize="false" - follows="bottom|left|right" + follows="all" name="outbox_layout_panel" visible="false" min_dim="35" @@ -153,6 +177,7 @@ <string name="OutboxLabelNoArg">Merchant Outbox</string> <button label="Merchant Outbox" + font="SansSerifMedium" name="outbox_btn" height="35" width="308" @@ -233,6 +258,8 @@ </panel> </panel> </layout_panel> + </layout_stack> + </layout_panel> </layout_stack> <panel follows="bottom|left|right" diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml index 0d1120a182..aeea8616b0 100644 --- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml +++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml @@ -10,10 +10,12 @@ label="New" label_offset_horiz="-1" location="right" - padding_horiz="4" - padding_vert="1" - location_offset_hcenter="-15" - border_image="" - image="Badge_Background_New" + padding_horiz="12.5" + padding_vert="2" + location_offset_hcenter="-23" + border_image="New_Tag_Border" + border_color="DkGray2" + image="New_Tag_Background" + image_color="Black" /> </inbox_folder_view_folder> |