summaryrefslogtreecommitdiff
path: root/indra/llui/llfloaterreg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llfloaterreg.cpp')
-rw-r--r--indra/llui/llfloaterreg.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index f5e6444287..1463d0bfbb 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -57,7 +57,7 @@ void LLFloaterReg::add(const std::string& name, const std::string& filename, con
}
//static
-LLRect LLFloaterReg::getFloaterRect(const std::string& name)
+LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name)
{
LLRect rect;
const std::string& groupname = sGroupMap[name];
@@ -66,20 +66,10 @@ LLRect LLFloaterReg::getFloaterRect(const std::string& name)
instance_list_t& list = sInstanceMap[groupname];
if (!list.empty())
{
- static LLUICachedControl<S32> floater_offset ("UIFloaterOffset", 16);
- LLFloater* last_floater = list.back();
- if (last_floater->getHost())
- {
- rect = last_floater->getHost()->getRect();
- }
- else
- {
- rect = last_floater->getRect();
- }
- rect.translate(floater_offset, -floater_offset);
+ return list.back();
}
}
- return rect;
+ return NULL;
}
//static
@@ -137,12 +127,12 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
res->applySavedVariables(); // Can't apply rect and dock state until setting instance name
if (res->mAutoTile && !res->getHost() && index > 0)
{
- const LLRect& cur_rect = res->getRect();
- LLRect next_rect = getFloaterRect(groupname);
- next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, cur_rect.getWidth(), cur_rect.getHeight());
- res->setRect(next_rect);
- res->setRectControl(LLStringUtil::null); // don't save rect of tiled floaters
- gFloaterView->adjustToFitScreen(res, true);
+ LLFloater* last_floater = getLastFloaterInGroup(groupname);
+ if (last_floater)
+ {
+ res->stackWith(*last_floater);
+ gFloaterView->adjustToFitScreen(res, true);
+ }
}
else
{