diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llchathistory.cpp | 2 | ||||
-rw-r--r-- | indra/newview/lltoastnotifypanel.cpp | 24 | ||||
-rw-r--r-- | indra/newview/lltoastnotifypanel.h | 11 |
3 files changed, 34 insertions, 3 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 911ac9c485..b2e49dd5c6 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -734,7 +734,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId); if (notification != NULL) { - LLToastNotifyPanel* notify_box = new LLToastNotifyPanel( + LLIMToastNotifyPanel* notify_box = new LLIMToastNotifyPanel( notification); //we can't set follows in xml since it broke toasts behavior notify_box->setFollowsLeft(); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 2f77936cad..7d0fb4a46f 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -526,4 +526,28 @@ void LLToastNotifyPanel::disableRespondedOptions(LLNotificationPtr& notification } } + +////////////////////////////////////////////////////////////////////////// + +#include "llscrollcontainer.h" +LLIMToastNotifyPanel::LLIMToastNotifyPanel(LLNotificationPtr& pNotification, const LLRect& rect /* = LLRect::null */) + : LLToastNotifyPanel(pNotification, rect) +{ + mTextBox->setFollowsAll(); +} + +void LLIMToastNotifyPanel::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */) +{ + S32 text_height = mTextBox->getTextBoundingRect().getHeight(); + S32 widget_height = mTextBox->getRect().getHeight(); + S32 delta = text_height - widget_height; + LLRect rc = getRect(); + + rc.setLeftTopAndSize(rc.mLeft, rc.mTop, width, height + delta); + height = rc.getHeight(); + width = rc.getWidth(); + + LLToastPanel::reshape(width, height, called_from_parent); +} + // EOF diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h index d565085e3c..a8d2d03236 100644 --- a/indra/newview/lltoastnotifypanel.h +++ b/indra/newview/lltoastnotifypanel.h @@ -79,8 +79,6 @@ protected: bool mCloseNotificationOnDestroy; -private: - typedef std::pair<int,LLButton*> index_button_pair_t; void adjustPanelForScriptNotice(S32 max_width, S32 max_height); void adjustPanelForTipNotice(); @@ -136,4 +134,13 @@ private: static const LLFontGL* sFontSmall; }; +class LLIMToastNotifyPanel : public LLToastNotifyPanel +{ +public: + + LLIMToastNotifyPanel(LLNotificationPtr& pNotification, const LLRect& rect = LLRect::null); + + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); +}; + #endif /* LLTOASTNOTIFYPANEL_H_ */ |