summaryrefslogtreecommitdiff
path: root/indra/newview/llchicletbar.cpp
diff options
context:
space:
mode:
authorPaul ProductEngine <pguslisty@productengine.com>2011-11-25 19:24:47 +0200
committerPaul ProductEngine <pguslisty@productengine.com>2011-11-25 19:24:47 +0200
commit8a442d5edb9074fa76856fc739b362a7374bc1cf (patch)
tree56be117dff55cea54a438d5ab7a1dc321c539c77 /indra/newview/llchicletbar.cpp
parentc577966d198889730cc1b4f4d43ec9c4865c47f6 (diff)
EXP-1463 FIXED (IM chiclets overlay Mini-Location bar)
- Now chiclet bar adjusts its width with Mini-Location bar
Diffstat (limited to 'indra/newview/llchicletbar.cpp')
-rw-r--r--indra/newview/llchicletbar.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index a17e1d13f5..1bd5a571a5 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,31 @@ 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;
+ 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);
+}