summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-07-26 15:16:21 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-07-26 15:16:21 +0300
commit5224e3d217cfb43670a88063b612e92d217a65aa (patch)
tree846445e34461bd6190bb16c4f8e965adbca3e220
parent27e17344842bc3986fde39473effd39999b02a2c (diff)
parentbdacad23bbc01118592c8656ae7bd58356d26ed9 (diff)
merge
--HG-- branch : product-engine
-rw-r--r--indra/llui/llaccordionctrl.cpp11
-rw-r--r--indra/llui/llaccordionctrltab.cpp15
-rw-r--r--indra/llui/llaccordionctrltab.h1
-rw-r--r--indra/newview/llpaneloutfitedit.cpp29
4 files changed, 51 insertions, 5 deletions
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index 2bc8ea054a..c3ef734823 100644
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -765,6 +765,17 @@ S32 LLAccordionCtrl::notifyParent(const LLSD& info)
}
return 0;
}
+ else if(str_action == "deselect_current")
+ {
+ // Reset selection to the currently selected tab.
+ if (mSelectedTab)
+ {
+ mSelectedTab->setSelected(false);
+ mSelectedTab = NULL;
+ return 1;
+ }
+ return 0;
+ }
}
else if (info.has("scrollToShowRect"))
{
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp
index 37fc571bbd..d8760d5cdb 100644
--- a/indra/llui/llaccordionctrltab.cpp
+++ b/indra/llui/llaccordionctrltab.cpp
@@ -371,9 +371,11 @@ LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p)
mHeader = LLUICtrlFactory::create<LLAccordionCtrlTabHeader>(headerParams);
addChild(mHeader, 1);
- if (p.selection_enabled)
+ LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLAccordionCtrlTab::selectOnFocusReceived, this));
+
+ if (!p.selection_enabled)
{
- LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLAccordionCtrlTab::selectOnFocusReceived, this));
+ LLFocusableElement::setFocusLostCallback(boost::bind(&LLAccordionCtrlTab::deselectOnFocusLost, this));
}
reshape(100, 200,FALSE);
@@ -598,6 +600,15 @@ void LLAccordionCtrlTab::selectOnFocusReceived()
getParent()->notifyParent(LLSD().with("action", "select_current"));
}
+void LLAccordionCtrlTab::deselectOnFocusLost()
+{
+ if(getParent()) // A parent may not be set if tabs are added dynamically.
+ {
+ getParent()->notifyParent(LLSD().with("action", "deselect_current"));
+ }
+
+}
+
S32 LLAccordionCtrlTab::getHeaderHeight()
{
return mHeaderVisible?HEADER_HEIGHT:0;
diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h
index 5646a355d0..0ef9c407f1 100644
--- a/indra/llui/llaccordionctrltab.h
+++ b/indra/llui/llaccordionctrltab.h
@@ -220,6 +220,7 @@ protected:
LLView* findContainerView ();
void selectOnFocusReceived();
+ void deselectOnFocusLost();
private:
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 38f637cabf..58a5529505 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -841,15 +841,38 @@ void LLPanelOutfitEdit::filterWearablesBySelectedItem(void)
bool more_than_one_selected = ids.size() > 1;
bool is_dummy_item = (ids.size() && dynamic_cast<LLPanelDummyClothingListItem*>(mCOFWearables->getSelectedItem()));
- //selected and expanded accordion tabs determine filtering when no item is selected
+ // selected, expanded accordion tabs and selection in flat list view determine filtering when no item is selected in COF
+ // selection in flat list view participates in determining filtering because of EXT-7963
+ // So the priority of criterions in is:
+ // 1. Selected accordion tab | IF (any accordion selected)
+ // | filter_type = selected_accordion_type
+ // 2. Selected item in flat list view | ELSEIF (any item in flat list view selected)
+ // | filter_type = selected_item_type
+ // 3. Expanded accordion tab | ELSEIF (any accordion expanded)
+ // | filter_type = expanded accordion_type
if (nothing_selected)
{
showWearablesListView();
- //selected accordion tab is more priority than expanded tab when determining filtering
+ //selected accordion tab is more priority than expanded tab
+ //and selected item in flat list view of 'Add more' panel when
+ //determining filtering
LLAssetType::EType type = mCOFWearables->getSelectedAccordionAssetType();
if (type == LLAssetType::AT_NONE)
- {
+ { //no accordion selected
+
+ // when no accordion selected then selected item from flat list view
+ // has more priority than expanded when determining filtering
+ LLUUID selected_item_id = mWearableItemsList->getSelectedUUID();
+ LLViewerInventoryItem* item = gInventory.getLinkedItem(selected_item_id);
+ if(item)
+ {
+ showFilteredWearablesListView(item->getWearableType());
+ return;
+ }
+
+ // when no accordion selected and no selected items in flat list view
+ // determine filtering according to expanded accordion
type = mCOFWearables->getExpandedAccordionAssetType();
}