summaryrefslogtreecommitdiff
path: root/indra/newview/llscreenchannel.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-11-29 12:10:14 -0600
committerDave Parks <davep@lindenlab.com>2011-11-29 12:10:14 -0600
commit1da7f4222479cc98bb85341de6a3bc93cd6fa4b4 (patch)
treedea648af2d44204f1abf1e84f07ede3317629157 /indra/newview/llscreenchannel.cpp
parent5374e544ed5888548bea334bd8ca7ca53372d031 (diff)
parent06a2d4eb274b1cd02b82bf2e5ffb458880ae8517 (diff)
merge
Diffstat (limited to 'indra/newview/llscreenchannel.cpp')
-rw-r--r--indra/newview/llscreenchannel.cpp42
1 files changed, 33 insertions, 9 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 15ba5195d9..5301955964 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -53,13 +53,22 @@ LLFastTimer::DeclareTimer FTM_GET_CHANNEL_RECT("Calculate Notification Channel R
LLRect LLScreenChannelBase::getChannelRect()
{
LLFastTimer _(FTM_GET_CHANNEL_RECT);
+
+ if (mFloaterSnapRegion == NULL)
+ {
+ mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region");
+ }
+
+ if (mChicletRegion == NULL)
+ {
+ mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container");
+ }
+
LLRect channel_rect;
LLRect chiclet_rect;
- LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region");
- floater_snap_region->localRectToScreen(floater_snap_region->getLocalRect(), &channel_rect);
- LLView* chiclet_region = gViewerWindow->getRootView()->getChildView("chiclet_container");
- chiclet_region->localRectToScreen(chiclet_region->getLocalRect(), &chiclet_rect);
+ mFloaterSnapRegion->localRectToScreen(mFloaterSnapRegion->getLocalRect(), &channel_rect);
+ mChicletRegion->localRectToScreen(mChicletRegion->getLocalRect(), &chiclet_rect);
channel_rect.mTop = chiclet_rect.mBottom;
return channel_rect;
@@ -81,14 +90,31 @@ LLScreenChannelBase::LLScreenChannelBase(const Params& p)
mShowToasts(true),
mID(p.id),
mDisplayToastsAlways(p.display_toasts_always),
- mChannelAlignment(p.channel_align)
-{
+ mChannelAlignment(p.channel_align),
+ mFloaterSnapRegion(NULL),
+ mChicletRegion(NULL)
+{
mID = p.id;
setMouseOpaque( false );
setVisible(FALSE);
}
+BOOL LLScreenChannelBase::postBuild()
+{
+ if (mFloaterSnapRegion == NULL)
+ {
+ mFloaterSnapRegion = gViewerWindow->getRootView()->getChildView("floater_snap_region");
+ }
+
+ if (mChicletRegion == NULL)
+ {
+ mChicletRegion = gViewerWindow->getRootView()->getChildView("chiclet_container");
+ }
+
+ return TRUE;
+}
+
void LLScreenChannelBase::reshape(S32 width, S32 height, BOOL called_from_parent)
{
redrawToasts();
@@ -473,12 +499,10 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel)
//--------------------------------------------------------------------------
void LLScreenChannel::redrawToasts()
{
- LLView* floater_snap_region = gViewerWindow->getRootView()->getChildView("floater_snap_region");
-
if (!getParent())
{
// connect to floater snap region just to get resize events, we don't care about being a proper widget
- floater_snap_region->addChild(this);
+ mFloaterSnapRegion->addChild(this);
setFollows(FOLLOWS_ALL);
}