From f263d119c4c4a3816da15e327afc99fd94d39eef Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 3 Nov 2009 19:46:57 -0500 Subject: EXT-2130 : XUI cleanup Reformatted sidepanel_inventory Took out tab container from both sidepanel_inventory and sidepanel_item_info --HG-- branch : avatar-pipeline --- indra/newview/llsidepanelinventory.cpp | 98 +-- indra/newview/llsidepanelinventory.h | 6 +- .../skins/default/xui/en/panel_main_inventory.xml | 830 ++++++++++----------- .../skins/default/xui/en/sidepanel_inventory.xml | 225 +++--- .../skins/default/xui/en/sidepanel_item_info.xml | 35 +- 5 files changed, 588 insertions(+), 606 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index dbe7e9fec6..2ea84efd30 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -44,7 +44,7 @@ static LLRegisterPanelClassWrapper t_inventory("sidepanel_ LLSidepanelInventory::LLSidepanelInventory() : LLPanel(), - mSidepanelItemInfo(NULL) + mItemPanel(NULL) { //LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() @@ -56,36 +56,40 @@ LLSidepanelInventory::~LLSidepanelInventory() BOOL LLSidepanelInventory::postBuild() { - mInfoBtn = getChild("info_btn"); - mInfoBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onInfoButtonClicked, this)); - - mShareBtn = getChild("share_btn"); - mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); - - mShareBtn = getChild("share_btn"); - mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); - - mWearBtn = getChild("wear_btn"); - mWearBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onWearButtonClicked, this)); - - mPlayBtn = getChild("play_btn"); - mPlayBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onPlayButtonClicked, this)); - - mTeleportBtn = getChild("teleport_btn"); - mTeleportBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onTeleportButtonClicked, this)); - - mOverflowBtn = getChild("overflow_btn"); - mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this)); - - mTabContainer = getChild("Inventory Tabs"); - mSidepanelItemInfo = getChild("sidepanel_item_info"); - - mPanelMainInventory = getChild("panel_main_inventory"); - mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); - - LLButton* back_btn = mSidepanelItemInfo->getChild("back_btn"); - back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); + // UI elements from inventory panel + { + mInventoryPanel = getChild("sidepanel__inventory_panel"); + + mInfoBtn = mInventoryPanel->getChild("info_btn"); + mInfoBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onInfoButtonClicked, this)); + + mShareBtn = mInventoryPanel->getChild("share_btn"); + mShareBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onShareButtonClicked, this)); + + mWearBtn = mInventoryPanel->getChild("wear_btn"); + mWearBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onWearButtonClicked, this)); + + mPlayBtn = mInventoryPanel->getChild("play_btn"); + mPlayBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onPlayButtonClicked, this)); + + mTeleportBtn = mInventoryPanel->getChild("teleport_btn"); + mTeleportBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onTeleportButtonClicked, this)); + + mOverflowBtn = mInventoryPanel->getChild("overflow_btn"); + mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this)); + + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild("panel_main_inventory"); + panel_main_inventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); + } + // UI elements from item panel + { + mItemPanel = getChild("sidepanel__item_panel"); + + LLButton* back_btn = mItemPanel->getChild("back_btn"); + back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); + } + return TRUE; } @@ -94,16 +98,16 @@ void LLSidepanelInventory::onOpen(const LLSD& key) if(key.size() == 0) return; - mSidepanelItemInfo->reset(); + mItemPanel->reset(); if (key.has("id")) { - mSidepanelItemInfo->setItemID(key["id"].asUUID()); + mItemPanel->setItemID(key["id"].asUUID()); } if (key.has("object")) { - mSidepanelItemInfo->setObjectID(key["object"].asUUID()); + mItemPanel->setObjectID(key["object"].asUUID()); } toggleItemInfoPanel(TRUE); @@ -114,8 +118,8 @@ void LLSidepanelInventory::onInfoButtonClicked() LLInventoryItem *item = getSelectedItem(); if (item) { - mSidepanelItemInfo->reset(); - mSidepanelItemInfo->setItemID(item->getUUID()); + mItemPanel->reset(); + mItemPanel->setItemID(item->getUUID()); toggleItemInfoPanel(TRUE); } } @@ -126,13 +130,13 @@ void LLSidepanelInventory::onShareButtonClicked() void LLSidepanelInventory::performActionOnSelection(const std::string &action) { - LLInventoryPanel *panel = mPanelMainInventory->getActivePanel(); - LLFolderViewItem* current_item = panel->getRootFolder()->getCurSelectedItem(); + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild("panel_main_inventory"); + LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { return; } - current_item->getListener()->performAction(panel->getRootFolder(), panel->getModel(), action); + current_item->getListener()->performAction(panel_main_inventory->getActivePanel()->getRootFolder(), panel_main_inventory->getActivePanel()->getModel(), action); } void LLSidepanelInventory::onWearButtonClicked() @@ -168,17 +172,18 @@ void LLSidepanelInventory::onSelectionChange(const std::deque void LLSidepanelInventory::toggleItemInfoPanel(BOOL visible) { - mSidepanelItemInfo->setVisible(visible); - mTabContainer->setVisible(!visible); + mItemPanel->setVisible(visible); + mInventoryPanel->setVisible(!visible); if (visible) { - mSidepanelItemInfo->dirty(); - mSidepanelItemInfo->setEditMode(FALSE); - + mItemPanel->dirty(); + mItemPanel->setEditMode(FALSE); + /* LLRect rect = getRect(); - LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom); - mSidepanelItemInfo->reshape(new_rect.getWidth(),new_rect.getHeight()); + LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mInventoryPanel->getRect().mBottom); + mItemPanel->reshape(new_rect.getWidth(),new_rect.getHeight()); + */ } } @@ -226,7 +231,8 @@ void LLSidepanelInventory::updateVerbs() LLInventoryItem *LLSidepanelInventory::getSelectedItem() { - LLFolderViewItem* current_item = mPanelMainInventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild("panel_main_inventory"); + LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { return NULL; diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index fbffb39b8c..f9fe3e4e0e 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -36,7 +36,6 @@ class LLInventoryItem; class LLSidepanelItemInfo; -class LLTabContainer; class LLPanelMainInventory; class LLFolderViewItem; @@ -78,9 +77,8 @@ private: LLButton* mTeleportBtn; LLButton* mOverflowBtn; - LLTabContainer* mTabContainer; - LLSidepanelItemInfo* mSidepanelItemInfo; - LLPanelMainInventory* mPanelMainInventory; + LLPanel* mInventoryPanel; // Main inventory view + LLSidepanelItemInfo* mItemPanel; // Individual item view }; #endif //LL_LLSIDEPANELINVENTORY_H diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 9a3fdcc327..8c5bf768d6 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -1,415 +1,415 @@ - - - - Things - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + Things + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 0b4a0e1e24..fc37bc07b8 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -1,122 +1,113 @@ - + background_visible="true" + follows="all" + height="570" + label="Things" + layout="topleft" + min_height="350" + min_width="240" + name="objects panel" + width="333"> - -