diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index b81492e69a..2863b28252 100644 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -31,7 +31,7 @@ #include "llmultifloater.h" #include "llresizehandle.h" -//#include "lldraghandle.h" CHUI Merge Check +#include "lldraghandle.h" // // LLMultiFloater @@ -57,7 +57,8 @@ void LLMultiFloater::buildTabContainer() p.rect(LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - floater_header_size, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0)); p.tab_position(mTabPos); p.follows.flags(FOLLOWS_ALL); - p.commit_callback.function(boost::bind(&LLMultiFloater::onTabSelected, this)); + // Update torn off status and add title bar + //p.commit_callback.function(boost::bind(&LLMultiFloater::onTabSelected, this)); mTabContainer = LLUICtrlFactory::create(p); addChild(mTabContainer); @@ -191,6 +192,13 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater, floater_data.mCanResize = floaterp->isResizable(); floater_data.mSaveRect = floaterp->mSaveRect; + // Update torn off status and add title bar + floaterp->getDragHandle()->setTitleVisible(FALSE); + LLRect rect = floaterp->getRect(); + rect.mTop -= floaterp->getHeaderHeight(); + floaterp->setRect(rect); + // + // remove minimize and close buttons floaterp->setCanMinimize(FALSE); floaterp->setCanResize(FALSE); @@ -241,6 +249,14 @@ void LLMultiFloater::updateFloaterTitle(LLFloater* floaterp) if (index != -1) { mTabContainer->setPanelTitle(index, floaterp->getShortTitle()); + // If the tab we're updating is the current tab, then + // update the overall title too, since we're showing it + // exclusively now. + if (floaterp == mTabContainer->getCurrentPanel()) + { + mDragHandle->setTitle(mTitle.getString() + " - " + floaterp->getTitle()); + } + // } } @@ -289,6 +305,13 @@ void LLMultiFloater::removeFloater(LLFloater* floaterp) if (!floaterp || floaterp->getHost() != this ) return; + // Update torn off status and add title bar + floaterp->getDragHandle()->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()) { @@ -438,9 +461,22 @@ void LLMultiFloater::onTabSelected() if (floaterp) { tabOpen(floaterp, true); + // Update torn off status and add title bar + mDragHandle->setTitle(mTitle.getString() + " - " + floaterp->getTitle()); } } +// Update torn off status and add title bar +void LLMultiFloater::setTabContainer(LLTabContainer* tab_container) +{ + if (!mTabContainer) + { + mTabContainer = tab_container; + mTabContainer->setCommitCallback(boost::bind(&LLMultiFloater::onTabSelected, this)); + } +} +// + void LLMultiFloater::setCanResize(BOOL can_resize) { LLFloater::setCanResize(can_resize); @@ -467,7 +503,10 @@ BOOL LLMultiFloater::postBuild() return TRUE; } - mTabContainer = getChild("Preview Tabs"); + // Update torn off status and add title bar + //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 0d9924bf22..44ef765f2c 100644 --- a/indra/llui/llmultifloater.h +++ b/indra/llui/llmultifloater.h @@ -71,8 +71,8 @@ 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 // Update torn off status and add title bar - void setTabContainer(LLTabContainer* tab_container) { if (!mTabContainer) mTabContainer = tab_container; } // LL Code - //void setTabContainer(LLTabContainer* tab_container); // FS Code - CHUI merge + //void setTabContainer(LLTabContainer* tab_container) { if (!mTabContainer) mTabContainer = tab_container; } // LL Code + void setTabContainer(LLTabContainer* tab_container); // Update torn off status and add title bar void onTabSelected();