From a543a1276e31ee165cbec8c3ed04961b2423ccac Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Tue, 1 Jun 2010 17:24:35 +0300 Subject: EXT-7527 FIXED repositioned "Add more..." button (panel edit outfit) - relocated Add button (required substantial layout_stacks repositioning) - got rid of switch/shop buttons - reverted addition of adaptors for (accordion tabs/list view) inline button bars * failed to get rid of an empty space above bottom bars when "add wearables panel" is invisible (due to bug in the layout stack, when border is still drawn below layout panel which is only one visible) https://jira.secondlife.com/secure/attachment/39854/empty+space+.jpg Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/481/ --HG-- branch : product-engine --- indra/newview/llcofwearables.cpp | 2 - indra/newview/llcofwearables.h | 47 --- indra/newview/llpaneloutfitedit.cpp | 35 +- indra/newview/llpaneloutfitedit.h | 2 +- .../skins/default/xui/en/panel_cof_wearables.xml | 66 +--- .../skins/default/xui/en/panel_outfit_edit.xml | 357 +++++++++++---------- 6 files changed, 225 insertions(+), 284 deletions(-) diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index ee366f4e3c..6acd16326a 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -46,8 +46,6 @@ #include "llpaneloutfitedit.h" #include "llsidetray.h" -static LLRegisterPanelClassWrapper t_cof_accodion_list_adaptor("accordion_list_adaptor"); - static LLRegisterPanelClassWrapper t_cof_wearables("cof_wearables"); const LLSD REARRANGE = LLSD().with("rearrange", LLSD()); diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 8f8bda2be8..f99f2662e6 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -45,53 +45,6 @@ class LLPanelClothingListItem; class LLPanelBodyPartsListItem; class LLPanelDeletableWearableListItem; -/** - * Adaptor between LLAccordionCtrlTab and LLFlatListView to facilitate communication between them - * (notify, notifyParent) regarding size changes of a list and selection changes across accordion tabs. - * Besides that it acts as a container for the LLFlatListView and a button bar on top of it. - */ -class LLCOFAccordionListAdaptor : public LLPanel -{ -public: - LLCOFAccordionListAdaptor() : LLPanel() {}; - ~LLCOFAccordionListAdaptor() {}; - - S32 notifyParent(const LLSD& info) - { - LLView* parent = getParent(); - if (!parent) return -1; - - if (!(info.has("action") && "size_changes" == info["action"].asString())) - { - return parent->notifyParent(info); - } - - LLRect rc; - childGetRect("button_bar", rc); - - LLSD params; - params["action"] = "size_changes"; - params["width"] = info["width"]; - params["height"] = info["height"].asInteger() + rc.getHeight(); - - return parent->notifyParent(params); - } - - - S32 notify(const LLSD& info) - { - for (child_list_const_iter_t iter = beginChild(); iter != endChild(); iter++) - { - if (dynamic_cast(*iter)) - { - return (*iter)->notify(info); - } - } - return LLPanel::notify(info); - }; -}; - - class LLCOFWearables : public LLPanel { public: diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 78de384cdc..85b4259a29 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -259,7 +259,6 @@ BOOL LLPanelOutfitEdit::postBuild() mFolderViewBtn = getChild("folder_view_btn"); mListViewBtn = getChild("list_view_btn"); - mAddToOutfitBtn = getChild("add_to_outfit_btn"); childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL); childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showFilteredFolderWearablesPanel, this), NULL); @@ -275,8 +274,6 @@ BOOL LLPanelOutfitEdit::postBuild() mCOFWearables->getCOFCallbacks().mMoveWearableCloser = boost::bind(&LLPanelOutfitEdit::moveWearable, this, true); mCOFWearables->getCOFCallbacks().mMoveWearableFurther = boost::bind(&LLPanelOutfitEdit::moveWearable, this, false); - mCOFWearables->childSetAction("add_btn", boost::bind(&LLPanelOutfitEdit::toggleAddWearablesPanel, this)); - mAddWearablesPanel = getChild("add_wearables_panel"); mInventoryItemsPanel = getChild("inventory_items"); @@ -298,7 +295,8 @@ BOOL LLPanelOutfitEdit::postBuild() mSearchFilter = getChild("look_item_filter"); mSearchFilter->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onSearchEdit, this, _2)); - + + childSetAction("show_add_wearables_btn", boost::bind(&LLPanelOutfitEdit::toggleAddWearablesPanel, this)); childSetAction("add_to_outfit_btn", boost::bind(&LLPanelOutfitEdit::onAddToOutfitClicked, this)); mEditWearableBtn = getChild("edit_wearable_btn"); @@ -341,15 +339,28 @@ void LLPanelOutfitEdit::moveWearable(bool closer_to_body) void LLPanelOutfitEdit::toggleAddWearablesPanel() { BOOL current_visibility = mAddWearablesPanel->getVisible(); - mAddWearablesPanel->setVisible(!current_visibility); + showAddWearablesPanel(!current_visibility); +} + +void LLPanelOutfitEdit::showAddWearablesPanel(bool show_add_wearables) +{ + mAddWearablesPanel->setVisible(show_add_wearables); + + childSetValue("show_add_wearables_btn", show_add_wearables); + + childSetVisible("filter_wearables_combobox", show_add_wearables); + childSetVisible("filter_button", show_add_wearables); - mFolderViewBtn->setVisible(!current_visibility); - mListViewBtn->setVisible(!current_visibility); - mAddToOutfitBtn->setVisible(!current_visibility); + //search filter should be disabled + if (!show_add_wearables) + { + childSetValue("filter_button", false); + showWearablesFilter(); + } - // Change right dummy icon to fill the toggled buttons space. - childSetVisible("add_wearables_dummy_icon", !current_visibility); - childSetVisible("dummy_right_icon", current_visibility); + //switching button bars + childSetVisible("no_add_wearables_button_bar", !show_add_wearables); + childSetVisible("add_wearables_button_bar", show_add_wearables); } void LLPanelOutfitEdit::showWearablesFilter() @@ -735,7 +746,7 @@ void LLPanelOutfitEdit::showFilteredWearableItemsList(LLWearableType::EType type { mWearableListTypeCollector->setType(type); mWearableListManager->setFilterCollector(mWearableListTypeCollector); - mAddWearablesPanel->setVisible(TRUE); + showAddWearablesPanel(true); showFilteredWearablesPanel(); } diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 1569c55732..6ce581f5f7 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -93,6 +93,7 @@ public: void moveWearable(bool closer_to_body); void toggleAddWearablesPanel(); + void showAddWearablesPanel(bool show__add_wearables); void showWearablesFilter(); void showFilteredWearablesPanel(); void showFilteredFolderWearablesPanel(); @@ -144,7 +145,6 @@ private: LLButton* mEditWearableBtn; LLButton* mFolderViewBtn; LLButton* mListViewBtn; - LLButton* mAddToOutfitBtn; LLPanel* mAddWearablesPanel; LLFindNonLinksByMask* mWearableListMaskCollector; diff --git a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml index cf84c31078..68c364680e 100644 --- a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml +++ b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml @@ -38,73 +38,31 @@ layout="topleft" name="tab_clothing" title="Clothing"> - - - - - - + width="311" /> - - - - - - + width="311" /> diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 93b5bb54e6..b2a399efe6 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -52,20 +52,7 @@ - -