summaryrefslogtreecommitdiff
path: root/indra/newview/lltoastnotifypanel.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-02-14 17:28:50 -0800
committerMerov Linden <merov@lindenlab.com>2013-02-14 17:28:50 -0800
commit4aa22db0379ba66017fe551c5466e4c1c6a888cb (patch)
treee302711c1f9e324ddefdc8ea821f4b980f28bf08 /indra/newview/lltoastnotifypanel.cpp
parent96bc3d206d890255300d367a70493f93cd0dc5f8 (diff)
parent638d94eef75799d47f8b913e0909b4079e55c03b (diff)
Pull merge from lindenlab/viewer-chui
Diffstat (limited to 'indra/newview/lltoastnotifypanel.cpp')
-rw-r--r--indra/newview/lltoastnotifypanel.cpp34
1 files changed, 27 insertions, 7 deletions
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 3fd056ea31..4ef5ad845c 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -259,12 +259,6 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
setXMLFilename("");
buildFromFile("panel_notification.xml");
- // reshape the panel to its previous size
- if (current_rect.notEmpty())
- {
- reshape(current_rect.getWidth(), current_rect.getHeight());
- }
-
if(rect != LLRect::null)
{
this->setShape(rect);
@@ -407,6 +401,12 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
//can shift upward making room for the buttons inside mControlPanel. After the buttons are added, the info panel can then be set to follow 'all'.
mInfoPanel->setFollowsAll();
snapToMessageHeight(mTextBox, MAX_LENGTH);
+
+ // reshape the panel to its previous size
+ if (current_rect.notEmpty())
+ {
+ reshape(current_rect.getWidth(), current_rect.getHeight());
+ }
}
//////////////////////////////////////////////////////////////////////////
@@ -426,7 +426,27 @@ LLIMToastNotifyPanel::~LLIMToastNotifyPanel()
void LLIMToastNotifyPanel::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */)
{
LLToastPanel::reshape(width, height, called_from_parent);
- snapToMessageHeight(mTextBox, MAX_LENGTH);
+ snapToMessageHeight();
+}
+
+void LLIMToastNotifyPanel::snapToMessageHeight()
+{
+ if(!mTextBox)
+ {
+ return;
+ }
+
+ //Add message height if it is visible
+ if (mTextBox->getVisible())
+ {
+ S32 new_panel_height = computeSnappedToMessageHeight(mTextBox, MAX_LENGTH);
+
+ //reshape the panel with new height
+ if (new_panel_height != getRect().getHeight())
+ {
+ LLToastNotifyPanel::reshape( getRect().getWidth(), new_panel_height);
+ }
+ }
}
void LLIMToastNotifyPanel::compactButtons()