diff options
author | mberezhnoy <mberezhnoy@productengine.com> | 2013-04-19 15:31:19 +0300 |
---|---|---|
committer | mberezhnoy <mberezhnoy@productengine.com> | 2013-04-19 15:31:19 +0300 |
commit | 6a339649844a6e016e35e440004a61d07dd490e6 (patch) | |
tree | ad042172a8731c338c96640c8c44d20501210096 | |
parent | 0b41fd503bf4388e911b21ab98479baebd5da31a (diff) |
CHUI-915 ([CHUIBUG]Control+W hides Conversations floater instead of closing active tab)
-rw-r--r-- | indra/newview/llfloaterimcontainer.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llfloaterimcontainer.h | 1 |
2 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index f89e818928..29a6060b0e 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -2020,7 +2020,9 @@ void LLFloaterIMContainer::expandConversation() } } -void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) +// For conversations, closeFloater() (linked to Ctrl-W) does not actually close the floater but the active conversation. +// This is intentional so it doesn't confuse the user. onClickCloseBtn() closes the whole floater. +void LLFloaterIMContainer::onClickCloseBtn() { // Always unminimize before trying to close. // Most of the time the user will never see this state. @@ -2029,7 +2031,25 @@ void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) LLMultiFloater::setMinimized(FALSE); } - LLFloater::closeFloater(app_quitting); + LLFloater::closeFloater(); +} + +void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) +{ + // Check for currently active session + LLUUID session_id = getSelectedSession(); + // If current session is Nearby Chat or there is only one session remaining, close the floater + if (mConversationsItems.size() == 1 || session_id == LLUUID()) + { + onClickCloseBtn(); + } + + // Otherwise, close current conversation + LLFloaterIMSessionTab* active_conversation = LLFloaterIMSessionTab::getConversation(session_id); + if (active_conversation) + { + active_conversation->closeFloater(); + } } // EOF diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index f6c716e2cf..060b81c603 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -130,6 +130,7 @@ private: void onStubCollapseButtonClicked(); void processParticipantsStyleUpdate(); void onSpeakButtonClicked(); + /*virtual*/ void onClickCloseBtn(); void collapseConversationsPane(bool collapse, bool save_is_allowed=true); |