summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llscreenchannel.cpp27
-rw-r--r--indra/newview/lltoast.cpp14
-rw-r--r--indra/newview/lltoast.h3
3 files changed, 29 insertions, 15 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 383e540394..73dcd1dd92 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -191,19 +191,22 @@ void LLScreenChannel::onToastFade(LLToast* toast)
{
std::vector<ToastElem>::iterator it = find(mToastList.begin(), mToastList.end(), static_cast<LLPanel*>(toast));
- bool delete_toast = !mCanStoreToasts || !toast->getCanBeStored();
- if(delete_toast)
- {
- mToastList.erase(it);
- deleteToast(toast);
- }
- else
+ if(it != mToastList.end())
{
- storeToast((*it));
- mToastList.erase(it);
- }
+ bool delete_toast = !mCanStoreToasts || !toast->getCanBeStored();
+ if(delete_toast)
+ {
+ mToastList.erase(it);
+ deleteToast(toast);
+ }
+ else
+ {
+ storeToast((*it));
+ mToastList.erase(it);
+ }
- redrawToasts();
+ redrawToasts();
+ }
}
//--------------------------------------------------------------------------
@@ -247,6 +250,7 @@ void LLScreenChannel::loadStoredToastsToChannel()
for(it = mStoredToastList.begin(); it != mStoredToastList.end(); ++it)
{
+ (*it).toast->setIsHidden(false);
(*it).toast->resetTimer();
mToastList.push_back((*it));
}
@@ -266,6 +270,7 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id)
mOverflowToastHidden = false;
LLToast* toast = (*it).toast;
+ toast->setIsHidden(false);
toast->resetTimer();
mToastList.push_back((*it));
mStoredToastList.erase(it);
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index eba43d76a6..b9c73076d2 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -63,6 +63,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);
@@ -143,7 +144,8 @@ void LLToast::hide()
{
setVisible(FALSE);
mTimer.stop();
- mOnFadeSignal(this);
+ mIsHidden = true;
+ mOnFadeSignal(this);
}
//--------------------------------------------------------------------------
@@ -159,9 +161,7 @@ void LLToast::tick()
{
if(mCanFade)
{
- setVisible(FALSE);
- mTimer.stop();
- mOnFadeSignal(this);
+ hide();
}
}
@@ -206,6 +206,12 @@ void LLToast::draw()
//--------------------------------------------------------------------------
void LLToast::setVisible(BOOL show)
{
+ if(mIsHidden)
+ {
+ // this toast is invisible untill its ScreenChannel will allow it
+ return;
+ }
+
if(show)
{
setBackgroundOpaque(TRUE);
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index 1826c13ebc..d4fddc3077 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -125,6 +125,8 @@ public:
void setCanBeStored(bool can_be_stored) { mCanBeStored = can_be_stored; }
//
bool getCanBeStored() { return mCanBeStored; }
+ // set whether this toast considered as hidden or not
+ void setIsHidden( bool is_toast_hidden ) { mIsHidden = is_toast_hidden; }
// Registers signals/callbacks for events
@@ -164,6 +166,7 @@ private:
bool mCanBeStored;
bool mHideBtnEnabled;
bool mHideBtnPressed;
+ bool mIsHidden; // this flag is TRUE when a toast has faded or was hidden with (x) button
};
}