summaryrefslogtreecommitdiff
path: root/indra/newview/llscreenchannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llscreenchannel.cpp')
-rw-r--r--indra/newview/llscreenchannel.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 61f4897ed0..0eeb89792b 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -136,12 +136,22 @@ void LLScreenChannelBase::init(S32 channel_left, S32 channel_right)
side_bar->getCollapseSignal().connect(boost::bind(&LLScreenChannelBase::resetPositionAndSize, this, _2));
}
+ // top and bottom set by updateBottom()
+ setRect(LLRect(channel_left, 0, channel_right, 0));
+ updateBottom();
+ setVisible(TRUE);
+}
+
+void LLScreenChannelBase::updateBottom()
+{
S32 channel_top = gViewerWindow->getWorldViewRectScaled().getHeight();
- S32 channel_bottom = gViewerWindow->getWorldViewRectScaled().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin");
+ S32 channel_bottom = gSavedSettings.getS32("ChannelBottomPanelMargin");
+ S32 channel_left = getRect().mLeft;
+ S32 channel_right = getRect().mRight;
setRect(LLRect(channel_left, channel_top, channel_right, channel_bottom));
- setVisible(TRUE);
}
+
//--------------------------------------------------------------------------
//////////////////////
// LLScreenChannel
@@ -253,8 +263,8 @@ void LLScreenChannel::addToast(const LLToast::Params& p)
if(mControlHovering)
{
new_toast_elem.toast->setOnToastHoverCallback(boost::bind(&LLScreenChannel::onToastHover, this, _1, _2));
- new_toast_elem.toast->setMouseEnterCallback(boost::bind(&LLScreenChannel::stopFadingToast, this, new_toast_elem.toast));
- new_toast_elem.toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startFadingToast, this, new_toast_elem.toast));
+ new_toast_elem.toast->setMouseEnterCallback(boost::bind(&LLScreenChannel::stopToastTimer, this, new_toast_elem.toast));
+ new_toast_elem.toast->setMouseLeaveCallback(boost::bind(&LLScreenChannel::startToastTimer, this, new_toast_elem.toast));
}
if(show_toast)
@@ -369,7 +379,7 @@ void LLScreenChannel::loadStoredToastsToChannel()
for(it = mStoredToastList.begin(); it != mStoredToastList.end(); ++it)
{
(*it).toast->setIsHidden(false);
- (*it).toast->startFading();
+ (*it).toast->startTimer();
mToastList.push_back((*it));
}
@@ -394,7 +404,7 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id)
}
toast->setIsHidden(false);
- toast->startFading();
+ toast->startTimer();
mToastList.push_back((*it));
redrawToasts();
@@ -477,7 +487,7 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel)
toast->removeChild(old_panel);
delete old_panel;
toast->insertPanel(panel);
- toast->startFading();
+ toast->startTimer();
redrawToasts();
}
}
@@ -511,6 +521,8 @@ void LLScreenChannel::showToastsBottom()
S32 toast_margin = 0;
std::vector<ToastElem>::reverse_iterator it;
+ updateBottom();
+
LLDockableFloater* floater = dynamic_cast<LLDockableFloater*>(LLDockableFloater::getInstanceHandle().get());
for(it = mToastList.rbegin(); it != mToastList.rend(); ++it)
@@ -583,20 +595,15 @@ void LLScreenChannel::showToastsBottom()
}
}
+ // Dismiss toasts we don't have space for (STORM-391).
if(it != mToastList.rend())
{
mHiddenToastsNum = 0;
for(; it != mToastList.rend(); it++)
{
- (*it).toast->stopFading();
- (*it).toast->setVisible(FALSE);
- mHiddenToastsNum++;
+ (*it).toast->hide();
}
}
- else
- {
- closeOverflowToastPanel();
- }
}
//--------------------------------------------------------------------------
@@ -697,15 +704,15 @@ void LLScreenChannel::closeStartUpToast()
}
}
-void LLNotificationsUI::LLScreenChannel::stopFadingToast(LLToast* toast)
+void LLNotificationsUI::LLScreenChannel::stopToastTimer(LLToast* toast)
{
if (!toast || toast != mHoveredToast) return;
// Pause fade timer of the hovered toast.
- toast->stopFading();
+ toast->stopTimer();
}
-void LLNotificationsUI::LLScreenChannel::startFadingToast(LLToast* toast)
+void LLNotificationsUI::LLScreenChannel::startToastTimer(LLToast* toast)
{
if (!toast || toast == mHoveredToast)
{
@@ -713,13 +720,12 @@ void LLNotificationsUI::LLScreenChannel::startFadingToast(LLToast* toast)
}
// Reset its fade timer.
- toast->startFading();
+ toast->startTimer();
}
//--------------------------------------------------------------------------
void LLScreenChannel::hideToastsFromScreen()
{
- closeOverflowToastPanel();
for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end(); it++)
(*it).toast->setVisible(FALSE);
}
@@ -850,13 +856,7 @@ void LLScreenChannel::updateShowToastsState()
return;
}
- S32 channel_bottom = gViewerWindow->getWorldViewRectScaled().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin");;
- LLRect this_rect = getRect();
-
- if(channel_bottom != this_rect.mBottom)
- {
- setRect(LLRect(this_rect.mLeft, this_rect.mTop, this_rect.mRight, channel_bottom));
- }
+ updateBottom();
}
//--------------------------------------------------------------------------