summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index d78a448acb..ba6473839a 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -133,10 +133,6 @@ mRemoveFromOutfitBtn(NULL), mLookObserver(NULL)
mLookItemTypes.push_back(LLLookItemType());
}
- // TODO: make these strings translatable
- mLookItemTypes[LIT_ALL] = LLLookItemType("All Items", ALL_ITEMS_MASK);
- mLookItemTypes[LIT_WEARABLE] = LLLookItemType("Shape & Clothing", WEARABLE_MASK);
- mLookItemTypes[LIT_ATTACHMENT] = LLLookItemType("Attachments", ATTACHMENT_MASK);
}
@@ -159,10 +155,15 @@ LLPanelOutfitEdit::~LLPanelOutfitEdit()
BOOL LLPanelOutfitEdit::postBuild()
{
// gInventory.isInventoryUsable() no longer needs to be tested per Richard's fix for race conditions between inventory and panels
-
+
+ mLookItemTypes[LIT_ALL] = LLLookItemType(getString("Filter.All"), ALL_ITEMS_MASK);
+ mLookItemTypes[LIT_WEARABLE] = LLLookItemType(getString("Filter.Clothes/Body"), WEARABLE_MASK);
+ mLookItemTypes[LIT_ATTACHMENT] = LLLookItemType(getString("Filter.Objects"), ATTACHMENT_MASK);
+
mCurrentOutfitName = getChild<LLTextBox>("curr_outfit_name");
childSetCommitCallback("add_btn", boost::bind(&LLPanelOutfitEdit::showAddWearablesPanel, this), NULL);
+ childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL);
mLookContents = getChild<LLScrollListCtrl>("look_items_list");
mLookContents->sortByColumn("look_item_sort", TRUE);
@@ -174,7 +175,7 @@ BOOL LLPanelOutfitEdit::postBuild()
mInventoryItemsPanel->setSelectCallback(boost::bind(&LLPanelOutfitEdit::onInventorySelectionChange, this, _1, _2));
mInventoryItemsPanel->getRootFolder()->setReshapeCallback(boost::bind(&LLPanelOutfitEdit::onInventorySelectionChange, this, _1, _2));
- LLComboBox* type_filter = getChild<LLComboBox>("inventory_filter");
+ LLComboBox* type_filter = getChild<LLComboBox>("filter_wearables_combobox");
type_filter->setCommitCallback(boost::bind(&LLPanelOutfitEdit::onTypeFilterChanged, this, _1));
type_filter->removeall();
for (U32 i = 0; i < mLookItemTypes.size(); ++i)
@@ -236,6 +237,11 @@ void LLPanelOutfitEdit::showAddWearablesPanel()
childSetVisible("add_wearables_panel", childGetValue("add_btn"));
}
+void LLPanelOutfitEdit::showWearablesFilter()
+{
+ childSetVisible("filter_combobox_panel", childGetValue("filter_button"));
+}
+
void LLPanelOutfitEdit::saveOutfit(bool as_new)
{
if (!as_new && LLAppearanceMgr::getInstance()->updateBaseOutfit())
@@ -457,20 +463,18 @@ void LLPanelOutfitEdit::onInventorySelectionChange(const std::deque<LLFolderView
void LLPanelOutfitEdit::onOutfitItemSelectionChange(void)
{
- S32 left_offset = -4;
- S32 top_offset = -10;
LLScrollListItem* item = mLookContents->getLastSelectedItem();
if (!item)
return;
- LLRect rect = item->getRect();
- LLRect btn_rect(
- left_offset + rect.mRight - 50,
- top_offset + rect.mTop,
- left_offset + rect.mRight - 30,
- top_offset + rect.mBottom);
+ LLRect item_rect;
+ mLookContents->localRectToOtherView(item->getRect(), &item_rect, getChild<LLUICtrl>("outfit_wearables_panel"));
+
+ // TODO button(and item list) should be removed (when new widget is ready)
+ LLRect btn_rect = mEditWearableBtn->getRect();
+ btn_rect.set(item_rect.mRight - btn_rect.getWidth(), item_rect.mTop, item_rect.mRight, item_rect.mBottom);
- mEditWearableBtn->setRect(btn_rect);
+ mEditWearableBtn->setShape(btn_rect);
mEditWearableBtn->setEnabled(TRUE);
if (!mEditWearableBtn->getVisible())