Skip to content
Snippets Groups Projects
Commit c331607d authored by Vadim Savchuk's avatar Vadim Savchuk
Browse files

STORM-185 FIXED Don't reset accordions in the Outfit Edit panel when a wearable gets worn.

The fix consists of two parts:
1. Saving/restoring scrollbar position when refreshing the clothing/attachments/bodyparts lists
   (the lists get refreshed on COF change).
2. Not resetting expanded accordion tab upon wearing an item (which was introduced with the fix of EXT-8164).

So, apart from preserving scrollbar position (which is what the bug reporter requests),
I also fixed that when you wear something, the Clothing accordion was always expanded.
parent 128bcffb
No related merge requests found
......@@ -397,12 +397,20 @@ void LLCOFWearables::refresh()
mCOFVersion = catp->getVersion();
// Save current scrollbar position.
typedef std::map<LLFlatListView*, LLRect> scroll_pos_map_t;
scroll_pos_map_t saved_scroll_pos;
saved_scroll_pos[mAttachments] = mAttachments->getVisibleContentRect();
saved_scroll_pos[mClothing] = mClothing->getVisibleContentRect();
saved_scroll_pos[mBodyParts] = mBodyParts->getVisibleContentRect();
// Save current selection.
typedef std::vector<LLSD> values_vector_t;
typedef std::map<LLFlatListView*, values_vector_t> selection_map_t;
selection_map_t preserve_selection;
// Save current selection
mAttachments->getSelectedValues(preserve_selection[mAttachments]);
mClothing->getSelectedValues(preserve_selection[mClothing]);
mBodyParts->getSelectedValues(preserve_selection[mBodyParts]);
......@@ -450,6 +458,15 @@ void LLCOFWearables::refresh()
list->setCommitOnSelectionChange(true);
}
// Restore previous scrollbar position.
for (scroll_pos_map_t::const_iterator it = saved_scroll_pos.begin(); it != saved_scroll_pos.end(); ++it)
{
LLFlatListView* list = it->first;
LLRect scroll_pos = it->second;
list->scrollToShowRect(scroll_pos);
}
}
......
......@@ -286,6 +286,8 @@ void LLSidepanelAppearance::showOutfitsInventoryPanel()
void LLSidepanelAppearance::showOutfitEditPanel()
{
if (mOutfitEdit && mOutfitEdit->getVisible()) return;
// Accordion's state must be reset in all cases except the one when user
// is returning back to the mOutfitEdit panel from the mEditWearable panel.
// The simplest way to control this is to check the visibility state of the mEditWearable
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment