diff options
Diffstat (limited to 'indra/newview/lltoastnotifypanel.cpp')
-rw-r--r-- | indra/newview/lltoastnotifypanel.cpp | 34 |
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() |