diff options
| author | Oz Linden <oz@lindenlab.com> | 2011-08-04 15:39:33 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2011-08-04 15:39:33 -0400 |
| commit | f42df4cd9fe8eb9e4a778dc9e5fdf94b4d6cfb59 (patch) | |
| tree | 837c1eebc58b227f7049ee857fa6bd8fbbd25121 /indra/llui/llfloaterreg.cpp | |
| parent | 94c171d89bae06d0bc259255a917db892019c369 (diff) | |
| parent | 0b81c19cbe809f041e628da334c305ea33fae2e9 (diff) | |
merge changes for storm-1538
Diffstat (limited to 'indra/llui/llfloaterreg.cpp')
| -rw-r--r-- | indra/llui/llfloaterreg.cpp | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 4677d535db..fc7dcfcc4e 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 @@ -129,17 +119,20 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) } // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe - res->mKey = key; + if (res->mKey.isUndefined()) + { + res->mKey = key; + } res->setInstanceName(name); 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 { |
