diff options
| author | Brad Kittenbrink <brad@lindenlab.com> | 2022-03-07 00:19:11 -0800 |
|---|---|---|
| committer | Brad Kittenbrink <brad@lindenlab.com> | 2022-03-07 00:19:11 -0800 |
| commit | 89ab1e4525445d5efc370c381f7c1e18faab8f16 (patch) | |
| tree | 3e1326470eddea3310bfd15867c9d54dd3b1652c /indra/llui/llfloaterreg.cpp | |
| parent | 40b80251e48d5f0ae3695d9019261f9e472f3e16 (diff) | |
| parent | 6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff) | |
Merge remote-tracking branch 'origin/master' into DRTVWR-550-mfa
Diffstat (limited to 'indra/llui/llfloaterreg.cpp')
| -rw-r--r-- | indra/llui/llfloaterreg.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 36a0cb0fd0..f888d7ff68 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -531,6 +531,58 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& } // static +// Same as toggleInstanceOrBringToFront but does not close floater. +// unlike showInstance() does not trigger onOpen() if already open +void LLFloaterReg::showInstanceOrBringToFront(const LLSD& sdname, const LLSD& key) +{ + std::string name = sdname.asString(); + LLFloater* instance = getInstance(name, key); + + + if (!instance) + { + LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL; + return; + } + + // If hosted, we need to take that into account + LLFloater* host = instance->getHost(); + + if (host) + { + if (host->isMinimized() || !host->isShown() || !host->isFrontmost()) + { + host->setMinimized(FALSE); + instance->openFloater(key); + instance->setVisibleAndFrontmost(true, key); + } + else if (!instance->getVisible()) + { + instance->openFloater(key); + instance->setVisibleAndFrontmost(true, key); + instance->setFocus(TRUE); + } + } + else + { + if (instance->isMinimized()) + { + instance->setMinimized(FALSE); + instance->setVisibleAndFrontmost(true, key); + } + else if (!instance->isShown()) + { + instance->openFloater(key); + instance->setVisibleAndFrontmost(true, key); + } + else if (!instance->isFrontmost()) + { + instance->setVisibleAndFrontmost(true, key); + } + } +} + +// static U32 LLFloaterReg::getVisibleFloaterInstanceCount() { U32 count = 0; |
