diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-06-25 01:02:22 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-06-25 01:02:22 +0300 |
commit | 5aec46243b8150171e18a426312cd55facbd2c49 (patch) | |
tree | 0af231e900445f3abf46458689a402b884623f6f /indra/llui/llfloater.cpp | |
parent | a9b82b9d89aa3d0460d142fc520bc6a8ba79574e (diff) | |
parent | 467d8339c970c253dada2cf0e1eed45be66593ac (diff) |
Merge branch 'master' into DRTVWR-540-maint
Diffstat (limited to 'indra/llui/llfloater.cpp')
-rw-r--r-- | indra/llui/llfloater.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index e9c980ad9a..8ceb411ede 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -58,6 +58,7 @@ #include "llhelp.h" #include "llmultifloater.h" #include "llsdutil.h" +#include "lluiusage.h" #include <boost/foreach.hpp> @@ -198,7 +199,9 @@ LLFloater::Params::Params() help_pressed_image("help_pressed_image"), open_callback("open_callback"), close_callback("close_callback"), - follows("follows") + follows("follows"), + rel_x("rel_x", 0), + rel_y("rel_y", 0) { changeDefault(visible, false); } @@ -267,6 +270,8 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mHasBeenDraggedWhileMinimized(FALSE), mPreviousMinimizedBottom(0), mPreviousMinimizedLeft(0), + mDefaultRelativeX(p.rel_x), + mDefaultRelativeY(p.rel_y), mMinimizeSignal(NULL) // mNotificationContext(NULL) { @@ -505,7 +510,12 @@ void LLFloater::destroy() // virtual LLFloater::~LLFloater() { - LLFloaterReg::removeInstance(mInstanceName, mKey); + if (!isDead()) + { + // If it's dead, instance is supposed to be already removed, and + // in case of single instance we can remove new one by accident + LLFloaterReg::removeInstance(mInstanceName, mKey); + } if( gFocusMgr.childHasKeyboardFocus(this)) { @@ -934,6 +944,15 @@ bool LLFloater::applyRectControl() saved_rect = true; } + else if ((mDefaultRelativeX != 0) && (mDefaultRelativeY != 0)) + { + mPosition.mX = mDefaultRelativeX; + mPosition.mY = mDefaultRelativeY; + mPositioning = LLFloaterEnums::POSITIONING_RELATIVE; + applyRelativePosition(); + + saved_rect = true; + } // remember updated position if (rect_specified) @@ -1631,6 +1650,7 @@ void LLFloater::bringToFront( S32 x, S32 y ) // virtual void LLFloater::setVisibleAndFrontmost(BOOL take_focus,const LLSD& key) { + LLUIUsage::instance().logFloater(getInstanceName()); LLMultiFloater* hostp = getHost(); if (hostp) { @@ -3198,6 +3218,9 @@ void LLFloater::initFromParams(const LLFloater::Params& p) mSingleInstance = p.single_instance; mReuseInstance = p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance; + mDefaultRelativeX = p.rel_x; + mDefaultRelativeY = p.rel_y; + mPositioning = p.positioning; mSaveRect = p.save_rect; |