diff options
author | Mark Palange <palange@lindenlab.com> | 2008-12-23 19:39:58 +0000 |
---|---|---|
committer | Mark Palange <palange@lindenlab.com> | 2008-12-23 19:39:58 +0000 |
commit | fb793870fe95f1951d7c30ea6068e187b9dededd (patch) | |
tree | 6d11632353ff4fb07133625ec5031b135b1e2882 /indra/llui/llfloater.cpp | |
parent | d182b9fb82b9c63f41d81bc80dbbfe627475facf (diff) |
QAR-1142 merging 1.22 RC0-RC4 changes.
svn merge -c 106471 svn+ssh://svn.lindenlab.com/svn/linden/qa/viewer_1-22-106055_merge
Diffstat (limited to 'indra/llui/llfloater.cpp')
-rw-r--r-- | indra/llui/llfloater.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index ffdca84001..22260b52cf 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -544,6 +544,7 @@ void LLFloater::close(bool app_quitting) if (getHost()) { ((LLMultiFloater*)getHost())->removeFloater(this); + gFloaterView->addChild(this); } if (getSoundFlags() != SILENT @@ -1318,8 +1319,8 @@ void LLFloater::onClickEdit(void *userdata) self->mEditing = self->mEditing ? FALSE : TRUE; } -// static -void LLFloater::closeFocusedFloater() +// static +LLFloater* LLFloater::getClosableFloaterFromFocus() { LLFloater* focused_floater = NULL; @@ -1336,10 +1337,32 @@ void LLFloater::closeFocusedFloater() if (iter == sFloaterMap.end()) { // nothing found, return - return; + return NULL; + } + + // The focused floater may not be closable, + // Find and close a parental floater that is closeable, if any. + for(LLFloater* floater_to_close = focused_floater; + NULL != floater_to_close; + floater_to_close = gFloaterView->getParentFloater(floater_to_close)) + { + if(floater_to_close->isCloseable()) + { + return floater_to_close; + } } - focused_floater->close(); + return NULL; +} + +// static +void LLFloater::closeFocusedFloater() +{ + LLFloater* floater_to_close = LLFloater::getClosableFloaterFromFocus(); + if(floater_to_close) + { + floater_to_close->close(); + } // if nothing took focus after closing focused floater // give it to next floater (to allow closing multiple windows via keyboard in rapid succession) |