summaryrefslogtreecommitdiff
path: root/indra/llui/llfloater.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2021-06-25 01:02:04 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2021-06-25 01:02:04 +0300
commit0ca16a1f95a56066ad07f85985ba3310c57dbf3b (patch)
treea5037fca626a4b5d9aaaf424596f43fbef07d43a /indra/llui/llfloater.cpp
parent1639e1ceb40fcbc9120857a75cb91fa509b13614 (diff)
parent467d8339c970c253dada2cf0e1eed45be66593ac (diff)
Merge branch 'master' into DRTVWR-527-maint
# Conflicts: # indra/newview/llinventorypanel.cpp
Diffstat (limited to 'indra/llui/llfloater.cpp')
-rw-r--r--indra/llui/llfloater.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index c03b024dd5..8ceb411ede 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -199,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);
}
@@ -268,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)
{
@@ -506,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))
{
@@ -935,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)
@@ -3200,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;