diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 81bd467ed5..caf59d5dc7 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1612,16 +1612,12 @@ void LLFloater::onClickTearOff(LLFloater* self) gFloaterView->adjustToFitScreen(self, FALSE); // give focus to new window to keep continuity for the user self->setFocus(TRUE); - self->setTornOff(true); } else //Attach to parent. { self->storeRectControl(); // save the current size and position -Zi self->setExpandedRect(self->getRect()); - // reset torn off before showing the floater in the new host, so the rect change - // doesn't overwrite our remembered rect. -Zi - self->setTornOff(false); LLMultiFloater* new_host = (LLMultiFloater*)self->mLastHostHandle.get(); if (new_host) { @@ -1780,6 +1776,7 @@ void LLFloater::draw() // draw highlight on title bar to indicate focus. RDW if(hasFocus() + && mTornOff && !getIsChrome() && !getCurrentTitle().empty()) { @@ -2012,6 +2009,7 @@ void LLFloater::updateTitleButtons() mButtons[i]->setVisible(TRUE); // the restore button should have a tab stop so that it takes action when you Ctrl-Tab to a minimized floater mButtons[i]->setTabStop(i == BUTTON_RESTORE); + sendChildToFront(mButtons[i]); } else { diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index 5b44d63c94..6f8f64d676 100644 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -31,6 +31,7 @@ #include "llmultifloater.h" #include "llresizehandle.h" +#include "lldraghandle.h" // // LLMultiFloater @@ -55,7 +56,6 @@ void LLMultiFloater::buildTabContainer() p.name(std::string("Preview Tabs")); p.rect(LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - floater_header_size, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0)); p.follows.flags(FOLLOWS_ALL); - p.commit_callback.function(boost::bind(&LLMultiFloater::onTabSelected, this)); p.tab_position(mTabPos); // remove existing tab container @@ -66,8 +66,7 @@ void LLMultiFloater::buildTabContainer() mTabContainer = NULL; } - mTabContainer = LLUICtrlFactory::create(p); - addChild(mTabContainer); + addChild(LLUICtrlFactory::create(p)); if (isResizable()) { @@ -197,6 +196,12 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater, floater_data.mCanMinimize = floaterp->isMinimizeable(); floater_data.mCanResize = floaterp->isResizable(); + // update torn off status and remove title bar + floaterp->setTornOff(FALSE); + floaterp->setTitleVisible(FALSE); + LLRect rect = floaterp->getRect(); + rect.mTop -= floaterp->getHeaderHeight(); + floaterp->setRect(rect); // remove minimize and close buttons floaterp->setCanMinimize(FALSE); floaterp->setCanResize(FALSE); @@ -294,6 +299,13 @@ void LLMultiFloater::removeFloater(LLFloater* floaterp) if (!floaterp || floaterp->getHost() != this ) return; + // update torn off status and add title bar + floaterp->setTornOff(TRUE); + floaterp->setTitleVisible(TRUE); + LLRect rect = floaterp->getRect(); + rect.mTop += floaterp->getHeaderHeight(); + floaterp->setRect(rect); + floater_data_map_t::iterator found_data_it = mFloaterDataMap.find(floaterp->getHandle()); if (found_data_it != mFloaterDataMap.end()) { @@ -439,6 +451,16 @@ void LLMultiFloater::onTabSelected() if (floaterp) { tabOpen(floaterp, true); + mDragHandle->setTitle(mTitle.getString() + " - " + floaterp->getTitle()); + } +} + +void LLMultiFloater::setTabContainer(LLTabContainer* tab_container) +{ + if (!mTabContainer) + { + mTabContainer = tab_container; + mTabContainer->setCommitCallback(boost::bind(&LLMultiFloater::onTabSelected, this)); } } @@ -468,7 +490,7 @@ BOOL LLMultiFloater::postBuild() return TRUE; } - mTabContainer = getChild("Preview Tabs"); + setTabContainer(getChild("Preview Tabs")); setCanResize(mResizable); return TRUE; diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h index 9fa917eca1..10fbd9bf23 100644 --- a/indra/llui/llmultifloater.h +++ b/indra/llui/llmultifloater.h @@ -70,7 +70,7 @@ public: virtual void setFloaterFlashing(LLFloater* floaterp, BOOL flashing); virtual BOOL closeAllFloaters(); //Returns FALSE if the floater could not be closed due to pending confirmation dialogs - void setTabContainer(LLTabContainer* tab_container) { if (!mTabContainer) mTabContainer = tab_container; } + void setTabContainer(LLTabContainer* tab_container); void onTabSelected(); virtual void updateResizeLimits(); diff --git a/indra/newview/fscontactsfloater.cpp b/indra/newview/fscontactsfloater.cpp index 2753d92b4b..1e8338edd1 100644 --- a/indra/newview/fscontactsfloater.cpp +++ b/indra/newview/fscontactsfloater.cpp @@ -181,8 +181,6 @@ void FSFloaterContacts::onOpen(const LLSD& key) setHost(NULL); // reparent to floater view gFloaterView->addChild(this); - // and remember we are torn off - setTornOff(TRUE); } else { diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 4d5dbf3423..f3492992c1 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -90,12 +90,9 @@ void LLIMFloaterContainer::onOpen(const LLSD& key) floater->setHost(NULL); // reparent to floater view gFloaterView->addChild(floater); - // and remember we are torn off - floater->setTornOff(TRUE); } else { - floater->setTornOff(FALSE); LLMultiFloater::showFloater(floater); } } diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 90a69b54da..c5f7cdbbb6 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -192,12 +192,9 @@ BOOL LLNearbyChat::postBuild() setHost(NULL); // reparent the floater to the main view gFloaterView->addChild(this); - // and remember we are torn off - setTornOff(TRUE); } else { - setTornOff(FALSE); floater_container->addFloater(this, FALSE); } floater_container->setVisible(FALSE);