summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp49
-rw-r--r--indra/newview/llpaneloutfitedit.h16
-rw-r--r--indra/newview/skins/default/xui/en/panel_outfit_edit.xml192
3 files changed, 154 insertions, 103 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 008661221a..1c74c8f26a 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -210,7 +210,11 @@ BOOL LLPanelOutfitEdit::postBuild()
mCurrentOutfitName = getChild<LLTextBox>("curr_outfit_name");
mStatus = getChild<LLTextBox>("status");
+ mFolderViewBtn = getChild<LLButton>("folder_view_btn");
+ mListViewBtn = getChild<LLButton>("list_view_btn");
+
childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL);
+ childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showFilteredFolderWearablesPanel, this), NULL);
childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showFilteredWearablesPanel, this), NULL);
mCOFWearables = getChild<LLCOFWearables>("cof_wearables_list");
@@ -267,8 +271,9 @@ BOOL LLPanelOutfitEdit::postBuild()
save_registar.add("Outfit.SaveAsNew.Action", boost::bind(&LLPanelOutfitEdit::saveOutfit, this, true));
mSaveMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_save_outfit.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
- mWearableListManager = new LLFilteredWearableListManager(
- getChild<LLInventoryItemsList>("filtered_wearables_list"), ALL_ITEMS_MASK);
+ mWearableItemsPanel = getChild<LLPanel>("filtered_wearables_panel");
+ mWearableItemsList = getChild<LLInventoryItemsList>("filtered_wearables_list");
+ mWearableListManager = new LLFilteredWearableListManager(mWearableItemsList, ALL_ITEMS_MASK);
return TRUE;
}
@@ -289,12 +294,33 @@ void LLPanelOutfitEdit::toggleAddWearablesPanel()
void LLPanelOutfitEdit::showWearablesFilter()
{
- childSetVisible("filter_combobox_panel", childGetValue("filter_button"));
+ bool filter_visible = childGetValue("filter_button");
+
+ childSetVisible("filter_panel", filter_visible);
+
+ if(!filter_visible)
+ {
+ mSearchFilter->clear();
+ onSearchEdit(LLStringUtil::null);
+ }
}
void LLPanelOutfitEdit::showFilteredWearablesPanel()
{
- childSetVisible("filtered_wearables_panel", !childIsVisible("filtered_wearables_panel"));
+ if(switchPanels(mInventoryItemsPanel, mWearableItemsPanel))
+ {
+ mFolderViewBtn->setToggleState(FALSE);
+ }
+ mListViewBtn->setToggleState(TRUE);
+}
+
+void LLPanelOutfitEdit::showFilteredFolderWearablesPanel()
+{
+ if(switchPanels(mWearableItemsPanel, mInventoryItemsPanel))
+ {
+ mListViewBtn->setToggleState(FALSE);
+ }
+ mFolderViewBtn->setToggleState(TRUE);
}
void LLPanelOutfitEdit::saveOutfit(bool as_new)
@@ -359,7 +385,7 @@ void LLPanelOutfitEdit::onSearchEdit(const std::string& string)
if (mSearchString == "")
{
mInventoryItemsPanel->setFilterSubString(LLStringUtil::null);
-
+ mWearableItemsList->setFilterSubString(LLStringUtil::null);
// re-open folders that were initially open
mSavedFolderState->setApply(TRUE);
mInventoryItemsPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
@@ -385,6 +411,8 @@ void LLPanelOutfitEdit::onSearchEdit(const std::string& string)
// set new filter string
mInventoryItemsPanel->setFilterSubString(mSearchString);
+ mWearableItemsList->setFilterSubString(mSearchString);
+
}
void LLPanelOutfitEdit::onAddToOutfitClicked(void)
@@ -540,4 +568,15 @@ void LLPanelOutfitEdit::updateVerbs()
}
+bool LLPanelOutfitEdit::switchPanels(LLPanel* switch_from_panel, LLPanel* switch_to_panel)
+{
+ if(switch_from_panel && switch_to_panel && !switch_to_panel->getVisible())
+ {
+ switch_from_panel->setVisible(FALSE);
+ switch_to_panel->setVisible(TRUE);
+ return true;
+ }
+ return false;
+}
+
// EOF
diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h
index 04c94e553f..cb8283fca3 100644
--- a/indra/newview/llpaneloutfitedit.h
+++ b/indra/newview/llpaneloutfitedit.h
@@ -42,6 +42,7 @@
#include "llremoteparcelrequest.h"
#include "llinventory.h"
+#include "llinventoryitemslist.h"
#include "llinventorymodel.h"
class LLButton;
@@ -87,6 +88,7 @@ public:
void toggleAddWearablesPanel();
void showWearablesFilter();
void showFilteredWearablesPanel();
+ void showFilteredFolderWearablesPanel();
void saveOutfit(bool as_new = false);
void showSaveMenu();
@@ -103,6 +105,14 @@ public:
void update();
void updateVerbs();
+ /**
+ * @brief Helper function. Shows one panel instead of another.
+ * If panels already switched does nothing and returns false.
+ * @param switch_from_panel panel to hide
+ * @param switch_to_panel panel to show
+ * @retun returns true if switching happened, false if not.
+ */
+ bool switchPanels(LLPanel* switch_from_panel, LLPanel* switch_to_panel);
private:
@@ -115,9 +125,13 @@ private:
LLSaveFolderState* mSavedFolderState;
std::string mSearchString;
LLButton* mEditWearableBtn;
+ LLButton* mFolderViewBtn;
+ LLButton* mListViewBtn;
LLToggleableMenu* mSaveMenu;
- LLFilteredWearableListManager* mWearableListManager;
+ LLFilteredWearableListManager* mWearableListManager;
+ LLInventoryItemsList* mWearableItemsList;
+ LLPanel* mWearableItemsPanel;
LLCOFObserver* mCOFObserver;
std::vector<LLLookItemType> mLookItemTypes;
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 3200951253..7961664516 100644
--- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
@@ -215,124 +215,120 @@
tab_group="2"
user_resize="true"
visible="false">
-
- <!-- *NOTE is not used, invisible and disabled -->
- <filter_editor
- background_image="TextField_Search_Off"
- enabled="false"
- follows="left|top|right"
- font="SansSerif"
- label="Filter"
+ <text
+ follows="top|left|right"
+ font="SansSerifBold"
+ height="13"
layout="topleft"
left="5"
- width="290"
+ name="add_to_outfit_label"
+ text_color="LtGray"
+ top="3"
+ value="Add to Outfit:"
+ use_ellipses="true"
+ width="150" />
+ <button
+ follows="top|left|right"
+ height="20"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay=""
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ is_toggle="true"
+ label="O"
+ layout="topleft"
+ left_pad="5"
+ name="filter_button"
+ top="3"
+ width="20" />
+ <combo_box
+ follows="top|left|right"
height="20"
- name="look_item_filter"
- text_color="black"
- text_pad_left="25"
- visible="false"/>
+ layout="topleft"
+ right="-5"
+ name="filter_wearables_combobox"
+ top="2"
+ width="110"/>
<layout_stack
animate="true"
follows="all"
- height="25"
- width="300"
+ height="155"
+ width="311"
layout="topleft"
- orientation="horizontal"
name="filter_panels"
- top="0"
+ top_pad="5"
left="0">
<layout_panel
+ auto_resize="true"
layout="topleft"
follows="left|top|right"
- height="25"
+ height="30"
label="IM Control Panel"
- name="filter_button_panel"
- width="150"
- auto_resize="true"
- user_resize="false">
- <text
- follows="top|left|right"
- font="SansSerifBold"
- height="13"
- layout="topleft"
- left="5"
- name="add_to_outfit_label"
- text_color="LtGray"
- top="3"
- value="Add to Outfit:"
- use_ellipses="true"
- width="270" />
- <button
- follows="top|right"
- height="20"
- image_hover_unselected="Toolbar_Middle_Over"
- image_overlay=""
- image_selected="Toolbar_Middle_Selected"
- image_unselected="Toolbar_Middle_Off"
- is_toggle="true"
- label="O"
- layout="topleft"
- right="-1"
- name="filter_button"
- top="3"
- width="20" />
+ name="filter_panel"
+ width="311"
+ user_resize="false"
+ visible="false">
+ <filter_editor
+ background_image="TextField_Search_Off"
+ enabled="true"
+ follows="left|top|right"
+ font="SansSerif"
+ label="Filter"
+ layout="topleft"
+ left="5"
+ width="290"
+ height="25"
+ name="look_item_filter"
+ text_color="black"
+ text_pad_left="25"
+ visible="true"/>
</layout_panel>
<layout_panel
auto_resize="true"
- height="25"
+ height="145"
min_width="130"
- name="filter_combobox_panel"
- width="150"
- user_resize="false"
- visible="false">
- <combo_box
- follows="top|left|right"
- height="20"
- layout="topleft"
- right="-5"
- name="filter_wearables_combobox"
- top="0"
- width="130"/>
+ name="inventory_panel"
+ width="311"
+ user_resize="true">
+ <inventory_panel
+ allow_multi_select="false"
+ border="false"
+ follows="left|top|right|bottom"
+ height="130"
+ layout="topleft"
+ left="0"
+ mouse_opaque="false"
+ name="inventory_items"
+ top_pad="5"
+ width="311"
+ visible="false"/>
+ <panel
+ name="filtered_wearables_panel"
+ background_opaque="true"
+ background_visible="true"
+ layout="topleft"
+ follows="left|top|right|bottom"
+ border="false"
+ height="130"
+ left="0"
+ mouse_opaque="false"
+ width="311"
+ top_delta="0"
+ visible="true">
+ <wearable_items_list
+ name="filtered_wearables_list"
+ allow_select="true"
+ layout="topleft"
+ follows="all"
+ width="311"
+ height="130"
+ left="0"
+ top="0"/>
+ </panel>
</layout_panel>
</layout_stack>
- <inventory_panel
- allow_multi_select="false"
- border="false"
- follows="left|top|right|bottom"
- height="155"
- layout="topleft"
- left="0"
- mouse_opaque="false"
- name="inventory_items"
- top_pad="5"
- width="300"/>
-
- <panel
- name="filtered_wearables_panel"
- background_opaque="true"
- background_visible="true"
- layout="topleft"
- follows="left|top|right|bottom"
- border="false"
- height="155"
- left="0"
- mouse_opaque="false"
- width="300"
- top_delta="0"
- visible="false">
- <wearable_items_list
- name="filtered_wearables_list"
- allow_select="true"
- layout="topleft"
- follows="all"
- width="300"
- height="155"
- left="0"
- top="0" />
- </panel>
-
<panel
background_visible="true"
bevel_style="none"
@@ -363,6 +359,7 @@
image_overlay=""
image_selected="Toolbar_Middle_Selected"
image_unselected="Toolbar_Middle_Off"
+ is_toggle="true"
label="F"
layout="topleft"
left_pad="1"
@@ -376,6 +373,7 @@
image_overlay=""
image_selected="Toolbar_Middle_Selected"
image_unselected="Toolbar_Middle_Off"
+ is_toggle="true"
label="L"
layout="topleft"
left_pad="1"