summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2009-11-18 18:03:48 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2009-11-18 18:03:48 +0200
commit40041fc2af7d711f8b0adfc2a6b6fdb07c708c37 (patch)
treefafa3d3c4cf35c6c2f42b1a33685d027e5522ae8
parent4dc294e6dc6a88201ccb2dce76eab25ca936e062 (diff)
Fixed normal priority bug EXT-2606 (Stand/Stop Flying btn disappear if movement floater looses focus).
--HG-- branch : product-engine
-rw-r--r--indra/newview/llmoveview.cpp40
-rw-r--r--indra/newview/llmoveview.h3
2 files changed, 27 insertions, 16 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
diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h
index 2664fe6e40..06463f02af 100644
--- a/indra/newview/llmoveview.h
+++ b/indra/newview/llmoveview.h
@@ -51,11 +51,12 @@ class LLFloaterMove
private:
LLFloaterMove(const LLSD& key);
- ~LLFloaterMove();
+ ~LLFloaterMove() {}
public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void setEnabled(BOOL enabled);
+ /*virtual*/ void setVisible(BOOL visible);
static F32 getYawRate(F32 time);
static void setFlyingMode(BOOL fly);
void setFlyingModeImpl(BOOL fly);