From 4cc5f81ddf0b9a190235e8946d7e438499d91639 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 14 Dec 2009 17:17:40 -0500 Subject: EXT-3370 integrate tab-ification to appearance sidepanel Moved elements around so that the bottom bar is contained in the outfits panel XUI changes by erica/chuck/nyx code changes by nyx code reviewed by Bigpapi --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llpaneloutfitsinventory.cpp | 53 +++---- indra/newview/llpaneloutfitsinventory.h | 19 +-- indra/newview/llsidepanelappearance.cpp | 14 -- indra/newview/llsidepanelappearance.h | 2 - .../default/xui/en/panel_outfits_inventory.xml | 157 +++++++++++++-------- .../skins/default/xui/en/sidepanel_appearance.xml | 76 ++-------- 7 files changed, 152 insertions(+), 171 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e361082f7b..ab06ac1691 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -973,7 +973,7 @@ bool LLInvFVBridge::isInOutfitsSidePanel() const dynamic_cast(LLSideTray::getInstance()->getPanel("panel_outfits_inventory")); if (!outfit_panel) return false; - return outfit_panel->isAccordionPanel(my_panel); + return outfit_panel->isTabPanel(my_panel); } // +=================================================+ diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 4511bca23a..5b36a5406a 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -75,12 +75,12 @@ LLPanelOutfitsInventory::~LLPanelOutfitsInventory() BOOL LLPanelOutfitsInventory::postBuild() { - initAccordionPanels(); + initTabPanels(); initListCommandsHandlers(); return TRUE; } -void LLPanelOutfitsInventory::updateParent() +void LLPanelOutfitsInventory::updateVerbs() { if (mParent) { @@ -127,7 +127,7 @@ void LLPanelOutfitsInventory::onSearchEdit(const std::string& string) mActivePanel->setFilterSubString(string); } -void LLPanelOutfitsInventory::onWear() +void LLPanelOutfitsInventory::onWearButtonClick() { LLFolderViewEventListener* listenerp = getCorrectListenerForAction(); if (listenerp) @@ -167,7 +167,7 @@ void LLPanelOutfitsInventory::onNew() void LLPanelOutfitsInventory::onSelectionChange(const std::deque &items, BOOL user_action) { updateListCommands(); - updateParent(); + updateVerbs(); if (getRootFolder()->needsAutoRename() && items.size()) { getRootFolder()->startRenamingSelectedItem(); @@ -234,13 +234,14 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() mListCommands->childSetAction("options_gear_btn", boost::bind(&LLPanelOutfitsInventory::onGearButtonClick, this)); mListCommands->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this)); mListCommands->childSetAction("add_btn", boost::bind(&LLPanelOutfitsInventory::onAddButtonClick, this)); - + mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this)); + LLDragAndDropButton* trash_btn = mListCommands->getChild("trash_btn"); trash_btn->setDragAndDropHandler(boost::bind(&LLPanelOutfitsInventory::handleDragAndDropToTrash, this - , _4 // BOOL drop - , _5 // EDragAndDropType cargo_type - , _7 // EAcceptance* accept - )); + , _4 // BOOL drop + , _5 // EDragAndDropType cargo_type + , _7 // EAcceptance* accept + )); mCommitCallbackRegistrar.add("panel_outfits_inventory_gear_default.Custom.Action", boost::bind(&LLPanelOutfitsInventory::onCustomAction, this, _2)); @@ -252,8 +253,10 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() void LLPanelOutfitsInventory::updateListCommands() { bool trash_enabled = isActionEnabled("delete"); + bool wear_enabled = isActionEnabled("wear"); mListCommands->childSetEnabled("trash_btn", trash_enabled); + mListCommands->childSetEnabled("wear_btn", wear_enabled); } void LLPanelOutfitsInventory::onGearButtonClick() @@ -308,7 +311,7 @@ void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata) } if (command_name == "wear") { - onWear(); + onWearButtonClick(); } if (command_name == "add") { @@ -407,41 +410,41 @@ bool LLPanelOutfitsInventory::handleDragAndDropToTrash(BOOL drop, EDragAndDropTy //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// -// Accordion // +// Tab panels // -void LLPanelOutfitsInventory::initAccordionPanels() +void LLPanelOutfitsInventory::initTabPanels() { - mAccordionPanels.resize(2); + mTabPanels.resize(2); LLInventoryPanel *myoutfits_panel = getChild("outfitslist_accordionpanel"); myoutfits_panel->setFilterTypes(1LL << LLFolderType::FT_OUTFIT, LLInventoryFilter::FILTERTYPE_CATEGORY); myoutfits_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mAccordionPanels[0] = myoutfits_panel; + mTabPanels[0] = myoutfits_panel; mActivePanel = myoutfits_panel; LLInventoryPanel *cof_panel = getChild("cof_accordionpanel"); cof_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mAccordionPanels[1] = cof_panel; + mTabPanels[1] = cof_panel; - for (accordionpanels_vec_t::iterator iter = mAccordionPanels.begin(); - iter != mAccordionPanels.end(); + for (tabpanels_vec_t::iterator iter = mTabPanels.begin(); + iter != mTabPanels.end(); ++iter) { LLInventoryPanel *panel = (*iter); - panel->setSelectCallback(boost::bind(&LLPanelOutfitsInventory::onAccordionSelectionChange, this, panel, _1, _2)); + panel->setSelectCallback(boost::bind(&LLPanelOutfitsInventory::onTabSelectionChange, this, panel, _1, _2)); } } -void LLPanelOutfitsInventory::onAccordionSelectionChange(LLInventoryPanel* accordion_panel, const std::deque &items, BOOL user_action) +void LLPanelOutfitsInventory::onTabSelectionChange(LLInventoryPanel* tab_panel, const std::deque &items, BOOL user_action) { if (user_action && items.size() > 0) { - for (accordionpanels_vec_t::iterator iter = mAccordionPanels.begin(); - iter != mAccordionPanels.end(); + for (tabpanels_vec_t::iterator iter = mTabPanels.begin(); + iter != mTabPanels.end(); ++iter) { LLInventoryPanel *panel = (*iter); - if (panel == accordion_panel) + if (panel == tab_panel) { mActivePanel = panel; } @@ -459,10 +462,10 @@ LLInventoryPanel* LLPanelOutfitsInventory::getActivePanel() return mActivePanel; } -bool LLPanelOutfitsInventory::isAccordionPanel(LLInventoryPanel *panel) +bool LLPanelOutfitsInventory::isTabPanel(LLInventoryPanel *panel) { - for(accordionpanels_vec_t::iterator it = mAccordionPanels.begin(); - it != mAccordionPanels.end(); + for(tabpanels_vec_t::iterator it = mTabPanels.begin(); + it != mTabPanels.end(); ++it) { if (*it == panel) diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index afeaef485d..9b6b483e3b 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -54,7 +54,6 @@ public: /*virtual*/ BOOL postBuild(); void onSearchEdit(const std::string& string); - void onWear(); void onAdd(); void onRemove(); void onEdit(); @@ -71,29 +70,30 @@ public: LLFolderView* getRootFolder(); protected: - void updateParent(); + void updateVerbs(); bool getIsCorrectType(const LLFolderViewEventListener *listenerp) const; private: LLSidepanelAppearance* mParent; LLSaveFolderState* mSavedFolderState; + public: ////////////////////////////////////////////////////////////////////////////////// - // Accordion // + // tab panels LLInventoryPanel* getActivePanel(); - bool isAccordionPanel(LLInventoryPanel *panel); + bool isTabPanel(LLInventoryPanel *panel); protected: - void initAccordionPanels(); - void onAccordionSelectionChange(LLInventoryPanel* accordion_panel, const std::deque &items, BOOL user_action); + void initTabPanels(); + void onTabSelectionChange(LLInventoryPanel* tab_panel, const std::deque &items, BOOL user_action); private: LLInventoryPanel* mActivePanel; - typedef std::vector accordionpanels_vec_t; - accordionpanels_vec_t mAccordionPanels; + typedef std::vector tabpanels_vec_t; + tabpanels_vec_t mTabPanels; - // Accordion // + // tab panels // //////////////////////////////////////////////////////////////////////////////// @@ -103,6 +103,7 @@ protected: void initListCommandsHandlers(); void updateListCommands(); void onGearButtonClick(); + void onWearButtonClick(); void onAddButtonClick(); void showActionMenu(LLMenuGL* menu, std::string spawning_view_name); void onTrashButtonClick(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index eb3695a371..30b0075c4b 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -113,9 +113,6 @@ BOOL LLSidepanelAppearance::postBuild() mEditAppearanceBtn = getChild("editappearance_btn"); mEditAppearanceBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditAppearanceButtonClicked, this)); - mWearBtn = getChild("wear_btn"); - mWearBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onWearButtonClicked, this)); - mEditBtn = getChild("edit_btn"); mEditBtn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onEditButtonClicked, this)); @@ -199,14 +196,6 @@ void LLSidepanelAppearance::onFilterEdit(const std::string& search_string) } } -void LLSidepanelAppearance::onWearButtonClicked() -{ - if (!mLookInfo->getVisible()) - { - mPanelOutfitsInventory->onWear(); - } -} - void LLSidepanelAppearance::onOpenOutfitButtonClicked() { const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getCurrentOutfitLink(); @@ -284,7 +273,6 @@ void LLSidepanelAppearance::toggleLookInfoPanel(BOOL visible) mLookInfo->setVisible(visible); mPanelOutfitsInventory->setVisible(!visible); mFilterEditor->setVisible(!visible); - mWearBtn->setVisible(!visible); mEditBtn->setVisible(!visible); mNewOutfitBtn->setVisible(!visible); mCurrOutfitPanel->setVisible(!visible); @@ -314,12 +302,10 @@ void LLSidepanelAppearance::updateVerbs() { const bool is_correct_type = (mPanelOutfitsInventory->getCorrectListenerForAction() != NULL); mEditBtn->setEnabled(is_correct_type); - mWearBtn->setEnabled(is_correct_type); } else { mEditBtn->setEnabled(FALSE); - mWearBtn->setEnabled(FALSE); } } diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 9c870f631a..8ef2088eda 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -67,7 +67,6 @@ private: void onOpenOutfitButtonClicked(); void onEditAppearanceButtonClicked(); - void onWearButtonClicked(); void onEditButtonClicked(); void onNewOutfitButtonClicked(); void onBackButtonClicked(); @@ -82,7 +81,6 @@ private: LLButton* mOpenOutfitBtn; LLButton* mEditAppearanceBtn; - LLButton* mWearBtn; LLButton* mEditBtn; LLButton* mNewOutfitBtn; LLPanel* mCurrOutfitPanel; diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml index db95d01b43..ab73f135b9 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml @@ -1,61 +1,104 @@ - - - - + + - - - - - - + left="0" + top="0" + height="500" + width="290" + mouse_opaque="true" + name="outfitslist_accordionpanel" + start_folder="My Outfits" /> + + + +