summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llnearbychathandler.cpp6
-rw-r--r--indra/newview/llscreenchannel.cpp22
-rw-r--r--indra/newview/llscreenchannel.h2
3 files changed, 18 insertions, 12 deletions
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index f06f4eab28..adb79fd4fd 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -336,10 +336,8 @@ void LLNearbyChatScreenChannel::showToastsBottom()
return;
LLRect toast_rect;
- S32 channel_bottom = gViewerWindow->getWorldViewRectScaled().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin");
- LLRect cur_rect = getRect();
- cur_rect.translate(0, channel_bottom - cur_rect.mBottom);
- setRect(cur_rect);
+ updateBottom();
+ S32 channel_bottom = getRect().mBottom;
S32 bottom = channel_bottom;
S32 margin = gSavedSettings.getS32("ToastGap");
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 5c923a0409..b90ff80294 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -136,12 +136,22 @@ void LLScreenChannelBase::init(S32 channel_left, S32 channel_right)
side_bar->getCollapseSignal().connect(boost::bind(&LLScreenChannelBase::resetPositionAndSize, this, _2));
}
+ // top and bottom set by updateBottom()
+ setRect(LLRect(channel_left, 0, channel_right, 0));
+ updateBottom();
+ setVisible(TRUE);
+}
+
+void LLScreenChannelBase::updateBottom()
+{
S32 channel_top = gViewerWindow->getWorldViewRectScaled().getHeight();
S32 channel_bottom = gViewerWindow->getWorldViewRectScaled().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin");
+ S32 channel_left = getRect().mLeft;
+ S32 channel_right = getRect().mRight;
setRect(LLRect(channel_left, channel_top, channel_right, channel_bottom));
- setVisible(TRUE);
}
+
//--------------------------------------------------------------------------
//////////////////////
// LLScreenChannel
@@ -512,6 +522,8 @@ void LLScreenChannel::showToastsBottom()
S32 toast_margin = 0;
std::vector<ToastElem>::reverse_iterator it;
+ updateBottom();
+
LLDockableFloater* floater = dynamic_cast<LLDockableFloater*>(LLDockableFloater::getInstanceHandle().get());
for(it = mToastList.rbegin(); it != mToastList.rend(); ++it)
@@ -866,13 +878,7 @@ void LLScreenChannel::updateShowToastsState()
return;
}
- S32 channel_bottom = gViewerWindow->getWorldViewRectScaled().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin");;
- LLRect this_rect = getRect();
-
- if(channel_bottom != this_rect.mBottom)
- {
- setRect(LLRect(this_rect.mLeft, this_rect.mTop, this_rect.mRight, channel_bottom));
- }
+ updateBottom();
}
//--------------------------------------------------------------------------
diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h
index 6cf6d97550..62f822458b 100644
--- a/indra/newview/llscreenchannel.h
+++ b/indra/newview/llscreenchannel.h
@@ -111,6 +111,8 @@ public:
LLUUID getChannelID() { return mID; }
protected:
+ void updateBottom();
+
// Channel's flags
bool mControlHovering;
LLToast* mHoveredToast;