* Bugs: EXT-1217, EXT-1274, EXT-1272
* Dev: EXT-1101
master
Steven Bennetts 2009-10-05 07:47:56 +00:00
parent 2451b82d8a
commit f9788fa6ce
5 changed files with 66 additions and 24 deletions

View File

@ -213,7 +213,7 @@ void LLScreenChannel::deleteToast(LLToast* toast)
toast->mOnDeleteToastSignal(toast);
// update channel's Hovering state
// turning hovering off mannualy because onMouseLeave won't happen if a toast was closed using a keyboard
// turning hovering off manually because onMouseLeave won't happen if a toast was closed using a keyboard
if(toast->hasFocus())
setHovering(false);
@ -372,7 +372,8 @@ void LLScreenChannel::redrawToasts()
void LLScreenChannel::showToastsBottom()
{
LLRect toast_rect;
S32 bottom = getRect().mBottom;
S32 bottom = getRect().mBottom - gFloaterView->getRect().mBottom;
S32 toast_margin = 0;
std::vector<ToastElem>::reverse_iterator it;
for(it = mToastList.rbegin(); it != mToastList.rend(); ++it)
@ -380,19 +381,20 @@ void LLScreenChannel::showToastsBottom()
if(it != mToastList.rbegin())
{
bottom = (*(it-1)).toast->getRect().mTop;
toast_margin = gSavedSettings.getS32("ToastMargin");
}
toast_rect = (*it).toast->getRect();
toast_rect.setLeftTopAndSize(getRect().mLeft, bottom + toast_rect.getHeight()+gSavedSettings.getS32("ToastMargin"), toast_rect.getWidth() ,toast_rect.getHeight());
toast_rect.setOriginAndSize(getRect().mLeft, bottom + toast_margin, toast_rect.getWidth() ,toast_rect.getHeight());
(*it).toast->setRect(toast_rect);
bool stop_showing_toasts = (*it).toast->getRect().mTop > getRect().getHeight();
bool stop_showing_toasts = (*it).toast->getRect().mTop > getRect().mTop;
if(!stop_showing_toasts)
{
if( it != mToastList.rend()-1)
{
stop_showing_toasts = ((*it).toast->getRect().mTop + gSavedSettings.getS32("OverflowToastHeight") + gSavedSettings.getS32("ToastMargin")) > getRect().getHeight();
stop_showing_toasts = ((*it).toast->getRect().mTop + gSavedSettings.getS32("OverflowToastHeight") + gSavedSettings.getS32("ToastMargin")) > getRect().mTop;
}
}
@ -477,6 +479,28 @@ void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer)
void LLScreenChannel::onOverflowToastHide()
{
mOverflowToastHidden = true;
// remove all hidden toasts from channel and save interactive notifications
for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end();)
{
if(!(*it).toast->getVisible())
{
if((*it).toast->getCanBeStored())
{
storeToast((*it));
}
else
{
deleteToast((*it).toast);
}
it = mToastList.erase(it);
}
else
{
++it;
}
}
}
//--------------------------------------------------------------------------
@ -583,9 +607,7 @@ void LLScreenChannel::removeAndStoreAllStorableToasts()
{
if((*it).toast->getCanBeStored())
{
mStoredToastList.push_back(*it);
mOnStoreToast((*it).toast->getPanel(), (*it).id);
(*it).toast->stopTimer();
storeToast(*(it));
it = mToastList.erase(it);
}
else
@ -664,14 +686,30 @@ void LLScreenChannel::updateShowToastsState()
return;
}
if(dynamic_cast<LLIMFloater*>(floater) || dynamic_cast<LLSysWellWindow*>(floater))
// for IM floaters showed in a docked state - prohibit showing of ani toast
if(dynamic_cast<LLIMFloater*>(floater))
{
setShowToasts(!(floater->getVisible() && floater->isDocked()));
if (!getShowToasts())
{
removeAndStoreAllStorableToasts();
}
}
// for Message Well floater showed in a docked state - adjust channel's height
if(dynamic_cast<LLSysWellWindow*>(floater))
{
S32 channel_bottom = gViewerWindow->getWorldViewRect().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin");;
LLRect this_rect = getRect();
if(floater->getVisible() && floater->isDocked())
{
channel_bottom += (floater->getRect().getHeight() + gSavedSettings.getS32("ToastMargin"));
}
if(channel_bottom != this_rect.mBottom)
{
setRect(LLRect(this_rect.mLeft, this_rect.mTop, this_rect.mRight, channel_bottom));
}
}
}

View File

@ -266,10 +266,6 @@ void LLSysWellWindow::toggleWindow()
if(!getVisible())
{
if(mChannel)
{
mChannel->removeAndStoreAllStorableToasts();
}
if(isWindowEmpty())
{
return;
@ -345,6 +341,13 @@ void LLSysWellWindow::reshapeWindow()
curRect.setLeftTopAndSize(curRect.mLeft, newY, MIN_WINDOW_WIDTH, new_window_height);
reshape(curRect.getWidth(), curRect.getHeight(), TRUE);
setRect(curRect);
// update notification channel state
// update on a window reshape is important only when a window is visible and docked
if(mChannel && getVisible() && isDocked())
{
mChannel->updateShowToastsState();
}
}
//---------------------------------------------------------------------------------

View File

@ -5,7 +5,7 @@
can_close="false"
center_horiz="true"
follows="top"
height="95"
height="110"
layout="topleft"
name="camera_floater"
help_topic="camera_floater"
@ -26,7 +26,7 @@
</floater.string>
<panel
border="true"
height="64"
height="79"
layout="topleft"
left="0"
top="0"
@ -46,7 +46,7 @@
scale_image="false"
sound_flags="3"
tool_tip="Orbit Camera Around Focus"
top="0"
top="15"
width="64" />
<joystick_track
follows="top|left"
@ -61,7 +61,7 @@
scale_image="false"
sound_flags="3"
tool_tip="Move Camera Up and Down, Left and Right"
top="0"
top="15"
visible="false"
width="64" />
<joystick_zoom

View File

@ -5,7 +5,7 @@
can_minimize="false"
center_horiz="true"
follows="bottom"
height="95"
height="110"
layout="topleft"
name="move_floater"
help_topic="move_floater"
@ -38,7 +38,7 @@
</string>
<panel
border="true"
height="70"
height="83"
follows="left|top"
layout="topleft"
left="0"
@ -57,7 +57,7 @@
picture_style="true"
scale_image="false"
tool_tip="Turn Left (press Left Arrow or A)"
top="35"
top="45"
width="25" />
<button
follows="left|bottom"
@ -83,7 +83,7 @@
picture_style="true"
scale_image="false"
tool_tip="Fly Up, Press &quot;E&quot;"
top="4"
top="14"
width="25" />
<button
follows="left|bottom"
@ -130,7 +130,7 @@
<!-- Width and height of this panel should be synchronized with panel_stand_stop_flying.xml -->
<panel
border="true"
height="25"
height="27"
layout="topleft"
left="0"
name="panel_modes"

View File

@ -28,7 +28,8 @@
name="show_help"
top="5"
right="-8"
width="28">
width="28"
tool_tip="Show Help">
<button.commit_callback
function="Button.ShowHelp" />
</button>