diff options
Diffstat (limited to 'indra/newview/lltoast.cpp')
-rw-r--r-- | indra/newview/lltoast.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index eba43d76a6..903df21e78 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -49,13 +49,15 @@ LLToast::Params::Params() enable_hide_btn("enable_hide_btn", true), force_show("force_show", false), force_store("force_store", false), + fading_time_secs("fading_time_secs", gSavedSettings.getS32("ToastFadingTime")), lifetime_secs("lifetime_secs", gSavedSettings.getS32("NotificationToastLifeTime")) {}; LLToast::LLToast(const LLToast::Params& p) : LLModalDialog(LLSD(), p.is_modal), mPanel(p.panel), - mToastLifetime(p.lifetime_secs), + mToastLifetime(p.lifetime_secs), + mToastFadingTime(p.fading_time_secs), mNotificationID(p.notif_id), mSessionID(p.session_id), mCanFade(p.can_fade), @@ -63,6 +65,7 @@ LLToast::LLToast(const LLToast::Params& p) mHideBtnEnabled(p.enable_hide_btn), mHideBtn(NULL), mNotification(p.notification), + mIsHidden(false), mHideBtnPressed(false) { LLUICtrlFactory::getInstance()->buildFloater(this, "panel_toast.xml", NULL); @@ -126,7 +129,7 @@ bool LLToast::lifetimeHasExpired() if (mTimer.getStarted()) { F32 elapsed_time = mTimer.getElapsedTimeF32(); - if ((mToastLifetime - elapsed_time) <= gSavedSettings.getS32("ToastOpaqueTime")) + if ((mToastLifetime - elapsed_time) <= mToastFadingTime) { setBackgroundOpaque(FALSE); } @@ -143,7 +146,8 @@ void LLToast::hide() { setVisible(FALSE); mTimer.stop(); - mOnFadeSignal(this); + mIsHidden = true; + mOnFadeSignal(this); } //-------------------------------------------------------------------------- @@ -159,9 +163,7 @@ void LLToast::tick() { if(mCanFade) { - setVisible(FALSE); - mTimer.stop(); - mOnFadeSignal(this); + hide(); } } @@ -206,6 +208,16 @@ void LLToast::draw() //-------------------------------------------------------------------------- void LLToast::setVisible(BOOL show) { + if(mIsHidden) + { + // this toast is invisible after fade until its ScreenChannel will allow it + // + // (EXT-1849) according to this bug a toast can be resurrected from + // invisible state if it faded during a teleportation + // then it fades a second time and causes a crash + return; + } + if(show) { setBackgroundOpaque(TRUE); |