Skip to content
Snippets Groups Projects
Commit b2cc39d4 authored by Dmitry Zaporozhan's avatar Dmitry Zaporozhan
Browse files

(work in progress) low task EXT-6377 - Embedded offer panels aren't reshaped...

(work in progress) low task EXT-6377 - Embedded offer panels aren't reshaped by height on IM window resize
Added new Toast panel class for use in IM floater. New class handles IM floater reshape and updates Toast height.

--HG--
branch : product-engine
parent a85497f5
No related branches found
No related tags found
No related merge requests found
...@@ -734,7 +734,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL ...@@ -734,7 +734,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId); LLNotificationPtr notification = LLNotificationsUtil::find(chat.mNotifId);
if (notification != NULL) if (notification != NULL)
{ {
LLToastNotifyPanel* notify_box = new LLToastNotifyPanel( LLIMToastNotifyPanel* notify_box = new LLIMToastNotifyPanel(
notification); notification);
//we can't set follows in xml since it broke toasts behavior //we can't set follows in xml since it broke toasts behavior
notify_box->setFollowsLeft(); notify_box->setFollowsLeft();
......
...@@ -526,4 +526,28 @@ void LLToastNotifyPanel::disableRespondedOptions(LLNotificationPtr& notification ...@@ -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 // EOF
...@@ -79,8 +79,6 @@ protected: ...@@ -79,8 +79,6 @@ protected:
bool mCloseNotificationOnDestroy; bool mCloseNotificationOnDestroy;
private:
typedef std::pair<int,LLButton*> index_button_pair_t; typedef std::pair<int,LLButton*> index_button_pair_t;
void adjustPanelForScriptNotice(S32 max_width, S32 max_height); void adjustPanelForScriptNotice(S32 max_width, S32 max_height);
void adjustPanelForTipNotice(); void adjustPanelForTipNotice();
...@@ -136,4 +134,13 @@ private: ...@@ -136,4 +134,13 @@ private:
static const LLFontGL* sFontSmall; 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_ */ #endif /* LLTOASTNOTIFYPANEL_H_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment