summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneleditwearable.cpp
diff options
context:
space:
mode:
authorAndrew Polunin <apolunin@productengine.com>2010-07-21 19:00:57 +0300
committerAndrew Polunin <apolunin@productengine.com>2010-07-21 19:00:57 +0300
commita96f47db68dd52fa94bc3e9f652623583f85c60a (patch)
treea9c1962e359cbf076ad527e25ac999bbc9b1bccc /indra/newview/llpaneleditwearable.cpp
parent258f67cd02627b8ab2b03f940f8f4fefe9f9848f (diff)
EXT-8164 FIXED (Accordions should be reset to default state after Edit Outfit panel reopening)
Now accordion on panels 'Edit Outfit', 'Editing Shape', 'Editing Hair', 'Editing Eyes', 'Editing Skin', 'Group Profile' and 'Place Profile' are reset when the panels are closed and then opened again. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/782/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
-rw-r--r--indra/newview/llpaneleditwearable.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index ec685405ed..62e6cdc79d 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -47,6 +47,7 @@
#include "llvoavatarself.h"
#include "lltexteditor.h"
#include "lltextbox.h"
+#include "llaccordionctrl.h"
#include "llaccordionctrltab.h"
#include "llagentwearables.h"
#include "llscrollingpanelparam.h"
@@ -666,6 +667,35 @@ void LLPanelEditWearable::updateAvatarHeightLabel()
mTxtAvatarHeight->appendText(this->mReplacementMetricUrl, false, param);
}
+void LLPanelEditWearable::onWearablePanelVisibilityChange(const LLSD &in_visible_chain, LLAccordionCtrl* accordion_ctrl)
+{
+ if (in_visible_chain.asBoolean() && accordion_ctrl != NULL)
+ {
+ accordion_ctrl->expandDefaultTab();
+ }
+}
+
+void LLPanelEditWearable::setWearablePanelVisibilityChangeCallback(LLPanel* bodypart_panel)
+{
+ if (bodypart_panel != NULL)
+ {
+ LLAccordionCtrl* accordion_ctrl = bodypart_panel->getChild<LLAccordionCtrl>("wearable_accordion");
+
+ if (accordion_ctrl != NULL)
+ {
+ bodypart_panel->setVisibleCallback(
+ boost::bind(&LLPanelEditWearable::onWearablePanelVisibilityChange, this, _2, accordion_ctrl));
+ }
+ else
+ {
+ llwarns << "accordion_ctrl is NULL" << llendl;
+ }
+ }
+ else
+ {
+ llwarns << "bodypart_panel is NULL" << llendl;
+ }
+}
// virtual
BOOL LLPanelEditWearable::postBuild()
@@ -695,6 +725,14 @@ BOOL LLPanelEditWearable::postBuild()
mPanelEyes = getChild<LLPanel>("edit_eyes_panel");
mPanelHair = getChild<LLPanel>("edit_hair_panel");
+ // Setting the visibility callback is applied only to the bodyparts panel
+ // because currently they are the only ones whose 'wearable_accordion' has
+ // multiple accordion tabs (see EXT-8164 for details).
+ setWearablePanelVisibilityChangeCallback(mPanelShape);
+ setWearablePanelVisibilityChangeCallback(mPanelSkin);
+ setWearablePanelVisibilityChangeCallback(mPanelEyes);
+ setWearablePanelVisibilityChangeCallback(mPanelHair);
+
//clothes
mPanelShirt = getChild<LLPanel>("edit_shirt_panel");
mPanelPants = getChild<LLPanel>("edit_pants_panel");