In-Group feature request: Ability to have chats torn off, by default.

Best viewed without space changes... or maybe it doesn't matter any more.
Debug setting OtherChatsTornOff added.
Added Open new IMs in separate floaters checkbox to  Adv. Chat.
Moved Show group name in chat to the right column on top of Adv. Chat panel.

So how's this work?
Two ways.. 1. The user opens a chat; 2. A chat is started from another party to the user.
In 1, we open the chat in a separate floater and focus the floater.
In 2, we check if there is a floater currently in focus before opening the chat
if so, we minimize the floater, setting focus back to whatever floater the user was focused on;
if not, we leave the new chat floater open and focused.

Note that this will NOT alter the default behavior at all, we can't be having that.
This commit is contained in:
Lirusaito
2012-12-31 17:06:30 -05:00
parent ba57bb1396
commit 4ec6f853d8
7 changed files with 60 additions and 6 deletions

View File

@@ -747,7 +747,18 @@ LLUUID LLIMMgr::addSession(
{
noteMutedUsers(floater, ids);
}
LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater);
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if(tear_off)
{
// removal sets up relationship for re-attach
LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater);
// reparent to floater view
gFloaterView->addChild(floater);
gFloaterView->bringToFront(floater);
}
else
LLFloaterChatterBox::getInstance(LLSD())->showFloater(floater);
}
else
{
@@ -1119,6 +1130,19 @@ LLFloaterIMPanel* LLIMMgr::createFloater(
dialog);
LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt);
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if (tear_off)
{
LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); // removal sets up relationship for re-attach
gFloaterView->addChild(floater); // reparent to floater view
LLFloater* focused_floater = gFloaterView->getFocusedFloater(); // obtain the focused floater
floater->open(); // make the new chat floater appear
if (focused_floater != NULL) // there was a focused floater
{
floater->setMinimized(true); // so minimize this one, for now
focused_floater->setFocus(true); // and work around focus being removed by focusing on the last
}
}
mFloaters.insert(floater->getHandle());
return floater;
}
@@ -1145,6 +1169,19 @@ LLFloaterIMPanel* LLIMMgr::createFloater(
dialog);
LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt);
static LLCachedControl<bool> tear_off("OtherChatsTornOff");
if (tear_off)
{
LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); // removal sets up relationship for re-attach
gFloaterView->addChild(floater); // reparent to floater view
LLFloater* focused_floater = gFloaterView->getFocusedFloater(); // obtain the focused floater
floater->open(); // make the new chat floater appear
if (focused_floater != NULL) // there was a focused floater
{
floater->setMinimized(true); // so minimize this one, for now
focused_floater->setFocus(true); // and work around focus being removed by focusing on the last
}
}
mFloaters.insert(floater->getHandle());
return floater;
}