diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-07-23 07:26:20 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-07-23 07:26:20 +0300 |
commit | b26bc394483b8315a4be31334d4e0947d845a4e1 (patch) | |
tree | 6bdc7ac2689aa8fef76292c6647b9137cb163606 /indra/llui/llfloater.cpp | |
parent | 07a118889e9a15391e950710864800e8d5c43efc (diff) | |
parent | be6066eae218856f7fd74b98968a75e5062fa830 (diff) |
Merge branch 'master' into DRTVWR-486
Diffstat (limited to 'indra/llui/llfloater.cpp')
-rw-r--r-- | indra/llui/llfloater.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index e9c980ad9a..0e42922543 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) { @@ -376,13 +381,15 @@ void LLFloater::layoutDragHandle() // static void LLFloater::updateActiveFloaterTransparency() { - sActiveControlTransparency = LLUI::getInstance()->mSettingGroups["config"]->getF32("ActiveFloaterTransparency"); + static LLCachedControl<F32> active_transparency(*LLUI::getInstance()->mSettingGroups["config"], "ActiveFloaterTransparency", 1.f); + sActiveControlTransparency = active_transparency; } // static void LLFloater::updateInactiveFloaterTransparency() { - sInactiveControlTransparency = LLUI::getInstance()->mSettingGroups["config"]->getF32("InactiveFloaterTransparency"); + static LLCachedControl<F32> inactive_transparency(*LLUI::getInstance()->mSettingGroups["config"], "InactiveFloaterTransparency", 0.95f); + sInactiveControlTransparency = inactive_transparency; } void LLFloater::addResizeCtrls() @@ -505,7 +512,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 +946,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 +1652,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 +3220,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; |