summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepanelappearance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llsidepanelappearance.cpp')
-rw-r--r--indra/newview/llsidepanelappearance.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index 7a7ffb9983..98cd0b88eb 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -190,13 +190,16 @@ void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility)
{
if (new_visibility.asBoolean())
{
- if ((mOutfitEdit && mOutfitEdit->getVisible()) || (mEditWearable && mEditWearable->getVisible()))
+ bool is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible();
+ bool is_wearable_edit_visible = mEditWearable && mEditWearable->getVisible();
+
+ if (is_outfit_edit_visible || is_wearable_edit_visible)
{
if (!gAgentCamera.cameraCustomizeAvatar() && gSavedSettings.getBOOL("AppearanceCameraMovement"))
{
gAgentCamera.changeCameraToCustomizeAvatar();
}
- if (mEditWearable && mEditWearable->getVisible())
+ if (is_wearable_edit_visible)
{
LLWearable *wearable_ptr = mEditWearable->getWearable();
if (gAgentWearables.getWearableIndex(wearable_ptr) == LLAgentWearables::MAX_CLOTHING_PER_TYPE)
@@ -205,6 +208,11 @@ void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility)
showOutfitEditPanel();
}
}
+
+ if (is_outfit_edit_visible)
+ {
+ mOutfitEdit->resetAccordionState();
+ }
}
}
else
@@ -283,6 +291,15 @@ void LLSidepanelAppearance::showOutfitsInventoryPanel()
void LLSidepanelAppearance::showOutfitEditPanel()
{
+ // 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
+ // BEFORE it is changed by the call to the toggleWearableEditPanel(FALSE, NULL, TRUE).
+ if (mEditWearable != NULL && !mEditWearable->getVisible() && mOutfitEdit != NULL)
+ {
+ mOutfitEdit->resetAccordionState();
+ }
+
togglMyOutfitsPanel(FALSE);
toggleWearableEditPanel(FALSE, NULL, TRUE); // don't switch out of edit appearance mode
toggleOutfitEditPanel(TRUE);