summaryrefslogtreecommitdiff
path: root/indra/newview/llchicletbar.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2011-12-13 11:15:18 -0800
committerTodd Stinson <stinson@lindenlab.com>2011-12-13 11:15:18 -0800
commit9d1db4f19ae7ca044e47d0fe4e605e14882351c5 (patch)
tree2d499d53b60b2486f1e6666f8b9fe2063f984d22 /indra/newview/llchicletbar.cpp
parent817c97c2f836948f210599a6f67e36a411b22c21 (diff)
parentdbc91a7fac9513bdd879c5c2dc82208e08eaad2d (diff)
Pull and merge from https://bitbucket.org/lindenlab/viewer-development.
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);
+}