summaryrefslogtreecommitdiff
path: root/indra/newview/llmoveview.cpp
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2009-11-19 12:19:11 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2009-11-19 12:19:11 +0200
commit58439da4c696f8dd6002e6399e4563cbda251a1e (patch)
tree261b81d6f3492b020852a03f8b358aabfd040836 /indra/newview/llmoveview.cpp
parentda2a0cfceb9fbc7c66f23f8820309f36b6629530 (diff)
parent88cce61b09d225df0bcd8aab9dbd2c5a01ee7e19 (diff)
Merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llmoveview.cpp')
-rw-r--r--indra/newview/llmoveview.cpp40
1 files changed, 25 insertions, 15 deletions
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 0ee883e221..93db337053 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -83,11 +83,6 @@ LLFloaterMove::LLFloaterMove(const LLSD& key)
{
}
-LLFloaterMove::~LLFloaterMove()
-{
- LLPanelStandStopFlying::getInstance()->reparent(NULL);
-}
-
// virtual
BOOL LLFloaterMove::postBuild()
{
@@ -161,6 +156,31 @@ void LLFloaterMove::setEnabled(BOOL enabled)
showModeButtons(enabled);
}
+// *NOTE: we assume that setVisible() is called on floater close.
+// virtual
+void LLFloaterMove::setVisible(BOOL visible)
+{
+ // Ignore excessive calls of this method (from LLTransientFloaterMgr?).
+ if (getVisible() == visible)
+ return;
+
+ if (visible)
+ {
+ // Attach the Stand/Stop Flying panel.
+ LLPanelStandStopFlying* ssf_panel = LLPanelStandStopFlying::getInstance();
+ ssf_panel->reparent(this);
+ const LLRect& mode_actions_rect = mModeActionsPanel->getRect();
+ ssf_panel->setOrigin(mode_actions_rect.mLeft, mode_actions_rect.mBottom);
+ }
+ else
+ {
+ // Detach the Stand/Stop Flying panel.
+ LLPanelStandStopFlying::getInstance()->reparent(NULL);
+ }
+
+ LLTransientDockableFloater::setVisible(visible);
+}
+
// static
F32 LLFloaterMove::getYawRate( F32 time )
{
@@ -429,16 +449,6 @@ void LLFloaterMove::showModeButtons(BOOL bShow)
if (NULL == mModeActionsPanel || mModeActionsPanel->getVisible() == bShow)
return;
mModeActionsPanel->setVisible(bShow);
-
- if (bShow)
- LLPanelStandStopFlying::getInstance()->reparent(NULL);
- else
- {
- LLPanelStandStopFlying* ssf_panel = LLPanelStandStopFlying::getInstance();
- ssf_panel->reparent(this);
- const LLRect& mode_actions_rect = mModeActionsPanel->getRect();
- ssf_panel->setOrigin(mode_actions_rect.mLeft, mode_actions_rect.mBottom);
- }
}
//static