summaryrefslogtreecommitdiff
path: root/indra/newview/llmoveview.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-10-18 17:40:04 -0400
committerOz Linden <oz@lindenlab.com>2011-10-18 17:40:04 -0400
commit53ce47fc1c2a713c6d7dd7fd9f98e50de727b974 (patch)
treefcc220f37f0de56d63c5f501e7c577463106eb69 /indra/newview/llmoveview.cpp
parentf36cf6f1bad7e239011ab3ad40dca8002f42083c (diff)
parent395a29717026221255d8bed57098afa52c49bff9 (diff)
merge changes for STORM-1654
Diffstat (limited to 'indra/newview/llmoveview.cpp')
-rw-r--r--indra/newview/llmoveview.cpp83
1 files changed, 24 insertions, 59 deletions
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 142ee40cc8..c3d8b91d67 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),
@@ -92,12 +90,8 @@ LLFloaterMove::~LLFloaterMove()
// virtual
BOOL LLFloaterMove::postBuild()
{
- setIsChrome(TRUE);
- setTitleVisible(TRUE); // restore title visibility after chrome applying
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");
@@ -155,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;
}
@@ -177,7 +171,7 @@ void LLFloaterMove::setVisible(BOOL visible)
LLPanelStandStopFlying::getInstance()->reparent(NULL);
}
- LLTransientDockableFloater::setVisible(visible);
+ LLFloater::setVisible(visible);
}
// static
@@ -441,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()
{
@@ -499,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);
@@ -513,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));
@@ -736,23 +694,30 @@ void LLPanelStandStopFlying::onStopFlyingButtonClick()
*/
void LLPanelStandStopFlying::updatePosition()
{
- LLBottomTray* tray = LLBottomTray::getInstance();
- if (!tray || mAttached) return;
+ if (mAttached) return;
- LLButton* movement_btn = tray->findChild<LLButton>(BOTTOM_TRAY_BUTTON_NAME);
+ S32 y_pos = 0;
+ S32 bottom_tb_center = 0;
+ if (LLToolBar* toolbar_bottom = gToolBarView->getChild<LLToolBar>("toolbar_bottom"))
+ {
+ y_pos = toolbar_bottom->getRect().getHeight();
+ bottom_tb_center = toolbar_bottom->getRect().getCenterX();
+ }
- S32 x = 0;
- if (movement_btn)
+ S32 left_tb_width = 0;
+ if (LLToolBar* toolbar_left = gToolBarView->getChild<LLToolBar>("toolbar_left"))
{
- // Align centers of the button and the panel.
- x = movement_btn->calcScreenRect().getCenterX() - getRect().getWidth()/2;
+ left_tb_width = toolbar_left->getRect().getWidth();
}
- else
+
+ if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("stand_stop_flying_container"))
{
- x = tray->calcScreenRect().getCenterX() - getRect().getWidth()/2;
+ panel_ssf_container->setOrigin(0, y_pos);
}
- setOrigin(x, 0);
-}
+ S32 x_pos = bottom_tb_center-getRect().getWidth()/2 - left_tb_width;
+
+ setOrigin( x_pos, 0);
+}
// EOF