summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-08-02 11:07:52 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2012-08-02 11:07:52 -0700
commit1728eca264b39822801d9bb6cdfdf56944081852 (patch)
tree695685519ef62ce83caed5168e491357e01b5392 /indra
parenta87b27c41ddef15fa4027549c38b0129107ff9f6 (diff)
parent0fa1e2b9ae41bb06e5c7db90900d4f469f44b8d3 (diff)
merge changes
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llfloater.cpp61
-rw-r--r--indra/llui/llfloater.h1
-rw-r--r--indra/llui/llmultifloater.cpp3
-rw-r--r--indra/llui/llmultifloater.h9
-rw-r--r--indra/newview/llimconversation.cpp15
-rw-r--r--indra/newview/llimfloatercontainer.cpp5
-rw-r--r--indra/newview/llnearbychat.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml3
8 files changed, 61 insertions, 38 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index a1c902d562..8145d6d347 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1175,7 +1175,6 @@ void LLFloater::setMinimized(BOOL minimize)
{
// minimized flag should be turned on before release focus
mMinimized = TRUE;
-
mExpandedRect = getRect();
// If the floater has been dragged while minimized in the
@@ -1248,7 +1247,6 @@ void LLFloater::setMinimized(BOOL minimize)
}
setOrigin( mExpandedRect.mLeft, mExpandedRect.mBottom );
-
if (mButtonsEnabled[BUTTON_RESTORE])
{
mButtonsEnabled[BUTTON_MINIMIZE] = TRUE;
@@ -1284,7 +1282,6 @@ void LLFloater::setMinimized(BOOL minimize)
// Reshape *after* setting mMinimized
reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE );
- applyPositioning(NULL, false);
}
make_ui_sound("UISndWindowClose");
@@ -1658,10 +1655,12 @@ void LLFloater::onClickTearOff(LLFloater* self)
gFloaterView->addChild(self);
self->openFloater(self->getKey());
-
- // only force position for floaters that don't have that data saved
- if (self->mRectControl.empty())
+ if (self->mSaveRect && !self->mRectControl.empty())
{
+ self->applyRectControl();
+ }
+ else
+ { // only force position for floaters that don't have that data saved
new_rect.setLeftTopAndSize(host_floater->getRect().mLeft + 5, host_floater->getRect().mTop - floater_header_size - 5, self->getRect().getWidth(), self->getRect().getHeight());
self->setRect(new_rect);
}
@@ -1675,6 +1674,10 @@ void LLFloater::onClickTearOff(LLFloater* self)
LLMultiFloater* new_host = (LLMultiFloater*)self->mLastHostHandle.get();
if (new_host)
{
+ if (self->mSaveRect)
+ {
+ self->storeRectControl();
+ }
self->setMinimized(FALSE); // to reenable minimize button if it was minimized
new_host->showFloater(self);
// make sure host is visible
@@ -1709,6 +1712,18 @@ void LLFloater::onClickHelp( LLFloater* self )
}
}
+void LLFloater::initRectControl()
+{
+ // save_rect and save_visibility only apply to registered floaters
+ if (mSaveRect)
+ {
+ std::string ctrl_name = getControlName(mInstanceName, mKey);
+ mRectControl = LLFloaterReg::declareRectControl(ctrl_name);
+ mPosXControl = LLFloaterReg::declarePosXControl(ctrl_name);
+ mPosYControl = LLFloaterReg::declarePosYControl(ctrl_name);
+ }
+}
+
// static
LLFloater* LLFloater::getClosableFloaterFromFocus()
{
@@ -2940,28 +2955,22 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list)
void LLFloater::setInstanceName(const std::string& name)
{
- if (name == mInstanceName)
- return;
- llassert_always(mInstanceName.empty());
- mInstanceName = name;
- if (!mInstanceName.empty())
+ if (name != mInstanceName)
{
- std::string ctrl_name = getControlName(mInstanceName, mKey);
-
- // save_rect and save_visibility only apply to registered floaters
- if (mSaveRect)
- {
- mRectControl = LLFloaterReg::declareRectControl(ctrl_name);
- mPosXControl = LLFloaterReg::declarePosXControl(ctrl_name);
- mPosYControl = LLFloaterReg::declarePosYControl(ctrl_name);
- }
- if (!mVisibilityControl.empty())
+ llassert_always(mInstanceName.empty());
+ mInstanceName = name;
+ if (!mInstanceName.empty())
{
- mVisibilityControl = LLFloaterReg::declareVisibilityControl(ctrl_name);
- }
- if(!mDocStateControl.empty())
- {
- mDocStateControl = LLFloaterReg::declareDockStateControl(ctrl_name);
+ std::string ctrl_name = getControlName(mInstanceName, mKey);
+ initRectControl();
+ if (!mVisibilityControl.empty())
+ {
+ mVisibilityControl = LLFloaterReg::declareVisibilityControl(ctrl_name);
+ }
+ if(!mDocStateControl.empty())
+ {
+ mDocStateControl = LLFloaterReg::declareDockStateControl(ctrl_name);
+ }
}
}
}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 5be6e6d922..a1cac64a4a 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -358,6 +358,7 @@ protected:
void stackWith(LLFloater& other);
+ virtual void initRectControl();
virtual bool applyRectControl();
bool applyDockState();
void applyPositioning(LLFloater* other, bool on_open);
diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp
index e80799b16d..02ff64dbc6 100644
--- a/indra/llui/llmultifloater.cpp
+++ b/indra/llui/llmultifloater.cpp
@@ -188,11 +188,13 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater,
floater_data.mHeight = floaterp->getRect().getHeight();
floater_data.mCanMinimize = floaterp->isMinimizeable();
floater_data.mCanResize = floaterp->isResizable();
+ floater_data.mSaveRect = floaterp->mSaveRect;
// remove minimize and close buttons
floaterp->setCanMinimize(FALSE);
floaterp->setCanResize(FALSE);
floaterp->setCanDrag(FALSE);
+ floaterp->mSaveRect = FALSE;
floaterp->storeRectControl();
// avoid double rendering of floater background (makes it more opaque)
floaterp->setBackgroundVisible(FALSE);
@@ -291,6 +293,7 @@ void LLMultiFloater::removeFloater(LLFloater* floaterp)
{
LLFloaterData& floater_data = found_data_it->second;
floaterp->setCanMinimize(floater_data.mCanMinimize);
+ floaterp->mSaveRect = floater_data.mSaveRect;
if (!floater_data.mCanResize)
{
// restore original size
diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h
index 44514a6246..d992212650 100644
--- a/indra/llui/llmultifloater.h
+++ b/indra/llui/llmultifloater.h
@@ -79,10 +79,11 @@ public:
protected:
struct LLFloaterData
{
- S32 mWidth;
- S32 mHeight;
- BOOL mCanMinimize;
- BOOL mCanResize;
+ S32 mWidth;
+ S32 mHeight;
+ BOOL mCanMinimize;
+ BOOL mCanResize;
+ BOOL mSaveRect;
};
LLTabContainer* mTabContainer;
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index 3e23d75d28..b56f30312a 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -103,15 +103,15 @@ BOOL LLIMConversation::postBuild()
mInputEditorTopPad = mChatHistory->getRect().mBottom - mInputEditor->getRect().mTop;
- if (!isTornOff())
- {
- setOpenPositioning(LLFloaterEnums::POSITIONING_RELATIVE);
- }
+ setOpenPositioning(LLFloaterEnums::POSITIONING_RELATIVE);
buildParticipantList();
updateHeaderAndToolbar();
+ mSaveRect = isTornOff();
+ initRectControl();
+
if (isChatMultiTab())
{
if (mIsNearbyChat)
@@ -364,12 +364,14 @@ void LLIMConversation::onSlide(LLIMConversation* self)
void LLIMConversation::onOpen(const LLSD& key)
{
LLIMFloaterContainer* host_floater = dynamic_cast<LLIMFloaterContainer*>(getHost());
- if (host_floater)
+ bool is_hosted = !!host_floater;
+ if (is_hosted)
{
// Show the messages pane when opening a floater hosted in the Conversations
host_floater->collapseMessagesPane(false);
}
+ setTornOff(!is_hosted);
updateHeaderAndToolbar();
}
@@ -389,6 +391,9 @@ void LLIMConversation::onClose(bool app_quitting)
void LLIMConversation::onTearOffClicked()
{
+ setFollows(isTornOff()? FOLLOWS_ALL : FOLLOWS_NONE);
+ mSaveRect = isTornOff();
+ initRectControl();
LLFloater::onClickTearOff(this);
updateHeaderAndToolbar();
}
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index cc094fcaa1..d618e7491a 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -174,6 +174,11 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
mSessions[session_id] = floaterp;
floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id));
}
+
+ // forced resize of the floater
+ LLRect wrapper_rect = this->mTabContainer->getLocalRect();
+ floaterp->setRect(wrapper_rect);
+
mTabContainer->setTabImage(floaterp, icon);
}
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index b628697bbc..8f0e6b4c83 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -150,8 +150,6 @@ BOOL LLNearbyChat::postBuild()
// Register for font change notifications
LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChat::onChatFontChange, this, _1));
- enableResizeCtrls(true, true, false);
-
// title must be defined BEFORE call addConversationListItem() because
// it is used for show the item's name in the conversations list
setTitle(getString("NearbyChatTitle"));
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 09c1510004..675967035f 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -15,7 +15,8 @@
can_resize="true"
can_tear_off="false"
min_width="250"
- min_height="190">
+ min_height="190"
+ positioning="relative">
<floater.string
name="NearbyChatTitle"
value="Nearby Chat"/>