summaryrefslogtreecommitdiff
path: root/indra/newview/llchicletbar.cpp
diff options
context:
space:
mode:
authorDebi King (Dessie) <dessie@lindenlab.com>2012-01-05 14:37:06 -0500
committerDebi King (Dessie) <dessie@lindenlab.com>2012-01-05 14:37:06 -0500
commitbf8e1137012c1e26d570545db1feda77c60aa6ba (patch)
treef2a0da29601da94b496c545436c1ef310bc4bed5 /indra/newview/llchicletbar.cpp
parentd8aa31d10a89aa826cc549594c083a054a2ad967 (diff)
parent7026c80d51128854458f585e50b3b9e3ecab555a (diff)
merge
Diffstat (limited to 'indra/newview/llchicletbar.cpp')
-rw-r--r--indra/newview/llchicletbar.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index a17e1d13f5..a879651060 100644
--- a/indra/newview/llchicletbar.cpp
+++ b/indra/newview/llchicletbar.cpp
@@ -35,6 +35,7 @@
// newview includes
#include "llchiclet.h"
#include "llimfloater.h" // for LLIMFloater
+#include "llpaneltopinfobar.h"
#include "llsyswellwindow.h"
namespace
@@ -181,6 +182,9 @@ BOOL LLChicletBar::postBuild()
showWellButton("im_well", !LLIMWellWindow::getInstance()->isWindowEmpty());
showWellButton("notification_well", !LLNotificationWellWindow::getInstance()->isWindowEmpty());
+ LLPanelTopInfoBar::instance().setResizeCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this));
+ LLPanelTopInfoBar::instance().setVisibleCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this));
+
return TRUE;
}
@@ -338,3 +342,33 @@ S32 LLChicletBar::getChicletPanelShrinkHeadroom() const
llassert(shrink_headroom >= 0); // the panel cannot get narrower than the minimum
return shrink_headroom;
}
+
+void LLChicletBar::fitWithTopInfoBar()
+{
+ LLPanelTopInfoBar& top_info_bar = LLPanelTopInfoBar::instance();
+
+ LLRect rect = getRect();
+ S32 width = rect.getWidth();
+
+ if (top_info_bar.getVisible())
+ {
+ S32 delta = top_info_bar.calcScreenRect().mRight - calcScreenRect().mLeft;
+ if (delta < 0 && rect.mLeft < llabs(delta))
+ delta = -rect.mLeft;
+ rect.setLeftTopAndSize(rect.mLeft + delta, rect.mTop, rect.getWidth(), rect.getHeight());
+ width = rect.getWidth() - delta;
+ }
+ else
+ {
+ LLView* parent = getParent();
+ if (parent)
+ {
+ LLRect parent_rect = parent->getRect();
+ rect.setLeftTopAndSize(0, rect.mTop, rect.getWidth(), rect.getHeight());
+ width = parent_rect.getWidth();
+ }
+ }
+
+ setRect(rect);
+ LLPanel::reshape(width, rect.getHeight(), false);
+}