summaryrefslogtreecommitdiff
path: root/indra/newview/lltoast.cpp
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2009-10-01 18:19:45 -0700
committerMark Palange (Mani) <palange@lindenlab.com>2009-10-01 18:19:45 -0700
commitdde2153014cd7d7b8fa704f7067a41344bfbb1c2 (patch)
treef7633ccef179644660897c8bf3684abeda3545f8 /indra/newview/lltoast.cpp
parent9b8b0571645f8b607ecc24221c807cc02a03692f (diff)
parent85ea690d47208f6dda020c8ff81021179fbdd0b8 (diff)
merge of latest lindenlab/svn-imports-viewer-20
Diffstat (limited to 'indra/newview/lltoast.cpp')
-rw-r--r--indra/newview/lltoast.cpp46
1 files changed, 18 insertions, 28 deletions
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index 97a15759bf..84931e4d2d 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -41,7 +41,7 @@
using namespace LLNotificationsUI;
//--------------------------------------------------------------------------
-LLToast::LLToast(LLToast::Params p) : LLFloater(LLSD()),
+LLToast::LLToast(LLToast::Params p) : LLModalDialog(LLSD(), p.is_modal),
mPanel(p.panel),
mTimerValue(p.timer_period),
mNotificationID(p.notif_id),
@@ -49,7 +49,6 @@ LLToast::LLToast(LLToast::Params p) : LLFloater(LLSD()),
mCanFade(p.can_fade),
mCanBeStored(p.can_be_stored),
mHideBtnEnabled(p.enable_hide_btn),
- mIsModal(p.is_modal),
mHideBtn(NULL),
mNotification(p.notification),
mHideBtnPressed(false)
@@ -67,13 +66,6 @@ LLToast::LLToast(LLToast::Params p) : LLFloater(LLSD()),
mHideBtn->setClickedCallback(boost::bind(&LLToast::hide,this));
}
- if(mIsModal)
- {
- gFocusMgr.setMouseCapture( this );
- gFocusMgr.setTopCtrl( this );
- setFocus(TRUE);
- }
-
// init callbacks if present
if(!p.on_delete_toast.empty())
mOnDeleteToastSignal.connect(p.on_delete_toast);
@@ -104,11 +96,6 @@ void LLToast::setHideButtonEnabled(bool enabled)
LLToast::~LLToast()
{
mOnToastDestroyedSignal(this);
- if(mIsModal)
- {
- gFocusMgr.unlockFocus();
- gFocusMgr.releaseFocusIfNeeded( this );
- }
}
//--------------------------------------------------------------------------
@@ -167,15 +154,30 @@ void LLToast::tick()
}
//--------------------------------------------------------------------------
-void LLToast::insertPanel(LLPanel* panel)
+
+void LLToast::reshapeToPanel()
{
- LLRect panel_rect, toast_rect;
+ LLPanel* panel = getPanel();
+ if(!panel)
+ return;
+
+ LLRect panel_rect;
panel_rect = panel->getRect();
reshape(panel_rect.getWidth(), panel_rect.getHeight());
panel_rect.setLeftTopAndSize(0, panel_rect.getHeight(), panel_rect.getWidth(), panel_rect.getHeight());
panel->setRect(panel_rect);
+
+ LLRect toast_rect = getRect();
+ toast_rect.setLeftTopAndSize(toast_rect.mLeft,toast_rect.mTop,panel_rect.getWidth(), panel_rect.getHeight());
+ setRect(toast_rect);
+
+}
+
+void LLToast::insertPanel(LLPanel* panel)
+{
addChild(panel);
+ reshapeToPanel();
}
//--------------------------------------------------------------------------
@@ -190,18 +192,6 @@ void LLToast::draw()
}
//--------------------------------------------------------------------------
-void LLToast::setModal(bool modal)
-{
- mIsModal = modal;
- if(mIsModal)
- {
- gFocusMgr.setMouseCapture( this );
- gFocusMgr.setTopCtrl( this );
- setFocus(TRUE);
- }
-}
-
-//--------------------------------------------------------------------------
void LLToast::setVisible(BOOL show)
{
if(show)