summaryrefslogtreecommitdiff
path: root/indra/newview/llmoveview.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2011-10-27 17:22:26 -0700
committerRichard Linden <none@none>2011-10-27 17:22:26 -0700
commit6e8ffc247fe52668446b8fa1ed7f1547a755076f (patch)
tree23b6fa5ce6bf6a32944faca54f9a18aca255fd75 /indra/newview/llmoveview.cpp
parent0ecc5c0878adf93e96b99e3db4c65cdb757b99fb (diff)
parentfcd1ccd21e3ea8f0944537347dd6c9d7972d50ce (diff)
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience
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