summaryrefslogtreecommitdiff
path: root/indra/newview/llmoveview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmoveview.cpp')
-rw-r--r--indra/newview/llmoveview.cpp76
1 files changed, 20 insertions, 56 deletions
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index a29526777a..2af01d06c1 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -37,7 +37,6 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "llvoavatarself.h" // to check gAgentAvatarp->isSitting()
-#include "llbottomtray.h"
#include "llbutton.h"
#include "llfirstuse.h"
#include "llfloaterreg.h"
@@ -46,7 +45,8 @@
#include "lluictrlfactory.h"
#include "llviewerwindow.h"
#include "llviewercontrol.h"
-#include "llselectmgr.h"
+#include "llselectmgr.h"
+#include "lltoolbarview.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "lltooltip.h"
@@ -59,15 +59,13 @@ const F32 MOVE_BUTTON_DELAY = 0.0f;
const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed
const F32 NUDGE_TIME = 0.25f; // in seconds
-const std::string BOTTOM_TRAY_BUTTON_NAME = "movement_btn";
-
//
// Member functions
//
// protected
LLFloaterMove::LLFloaterMove(const LLSD& key)
-: LLTransientDockableFloater(NULL, true, key),
+: LLFloater(key),
mForwardButton(NULL),
mBackwardButton(NULL),
mTurnLeftButton(NULL),
@@ -94,8 +92,6 @@ BOOL LLFloaterMove::postBuild()
{
updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
- LLDockableFloater::postBuild();
-
// Code that implements floater buttons toggling when user moves via keyboard is located in LLAgent::propagate()
mForwardButton = getChild<LLJoystickAgentTurn>("forward btn");
@@ -153,10 +149,10 @@ BOOL LLFloaterMove::postBuild()
// virtual
void LLFloaterMove::setVisible(BOOL visible)
{
- // Do nothing with Stand/Stop Flying panel in excessive calls of this method (from LLTransientFloaterMgr?).
+ // Do nothing with Stand/Stop Flying panel in excessive calls of this method.
if (getVisible() == visible)
{
- LLTransientDockableFloater::setVisible(visible);
+ LLFloater::setVisible(visible);
return;
}
@@ -175,7 +171,7 @@ void LLFloaterMove::setVisible(BOOL visible)
LLPanelStandStopFlying::getInstance()->reparent(NULL);
}
- LLTransientDockableFloater::setVisible(visible);
+ LLFloater::setVisible(visible);
}
// static
@@ -439,30 +435,6 @@ void LLFloaterMove::setModeTitle(const EMovementMode mode)
setTitle(title);
}
-/**
- * Updates position of the floater to be center aligned with Move button.
- */
-void LLFloaterMove::updatePosition()
-{
- LLBottomTray* tray = LLBottomTray::getInstance();
- if (!tray) return;
-
- LLButton* movement_btn = tray->findChild<LLButton>(BOTTOM_TRAY_BUTTON_NAME);
-
- if (movement_btn)
- {
- //align centers of a button and a floater
- S32 x = movement_btn->calcScreenRect().getCenterX() - getRect().getWidth()/2;
-
- S32 y = 0;
- if (!mModeActionsPanel->getVisible())
- {
- y = mModeActionsPanel->getRect().getHeight();
- }
- setOrigin(x, y);
- }
-}
-
//static
void LLFloaterMove::sUpdateFlyingStatus()
{
@@ -497,8 +469,6 @@ void LLFloaterMove::enableInstance(BOOL bEnable)
void LLFloaterMove::onOpen(const LLSD& key)
{
- LLButton *anchor_panel = LLBottomTray::getInstance()->getChild<LLButton>("movement_btn");
-
if (gAgent.getFlying())
{
setFlyingMode(TRUE);
@@ -511,19 +481,9 @@ void LLFloaterMove::onOpen(const LLSD& key)
showModeButtons(FALSE);
}
- setDockControl(new LLDockControl(
- anchor_panel, this,
- getDockTongue(), LLDockControl::TOP));
-
sUpdateFlyingStatus();
}
-//virtual
-void LLFloaterMove::setDocked(bool docked, bool pop_on_undock/* = true*/)
-{
- LLTransientDockableFloater::setDocked(docked, pop_on_undock);
-}
-
void LLFloaterMove::setModeButtonToggleState(const EMovementMode mode)
{
llassert_always(mModeControlButtonMap.end() != mModeControlButtonMap.find(mode));
@@ -734,23 +694,27 @@ void LLPanelStandStopFlying::onStopFlyingButtonClick()
*/
void LLPanelStandStopFlying::updatePosition()
{
- LLBottomTray* tray = LLBottomTray::getInstance();
- if (!tray || mAttached) return;
-
- LLButton* movement_btn = tray->findChild<LLButton>(BOTTOM_TRAY_BUTTON_NAME);
+ if (mAttached) return;
S32 x = 0;
- if (movement_btn)
+ S32 y = 0;
+
+ if(LLView* root = getRootView())
{
- // Align centers of the button and the panel.
- x = movement_btn->calcScreenRect().getCenterX() - getRect().getWidth()/2;
+ x = root->calcScreenRect().getCenterX() - getRect().getWidth()/2;
}
- else
+
+ if (LLToolBar* toolbar_bottom = gToolBarView->getChild<LLToolBar>("toolbar_bottom"))
{
- x = tray->calcScreenRect().getCenterX() - getRect().getWidth()/2;
+ y = toolbar_bottom->getRect().getHeight();
}
+
+ if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("stand_stop_flying_container"))
+ {
+ panel_ssf_container->setOrigin(0, y);
+ }
+
setOrigin(x, 0);
}
-
// EOF