Update for normal task EXT-3089 - Notification toasts positioning, layering and stacking.

Improved functionality, cleaned code.

--HG--
branch : product-engine
master
Dmitry Zaporozhan 2009-12-08 12:17:10 +02:00
parent 3dee439c1d
commit e6210e82d3
7 changed files with 19 additions and 21 deletions

View File

@ -83,6 +83,8 @@ public:
virtual void onDockHidden();
virtual void onDockShown();
LLDockControl* getDockControl();
private:
/**
* Provides unique of dockable floater.
@ -92,7 +94,6 @@ private:
protected:
void setDockControl(LLDockControl* dockControl);
LLDockControl* getDockControl();
const LLUIImagePtr& getDockTongue();
private:

View File

@ -76,6 +76,9 @@ public:
// gets a rect that bounds possible positions for a dockable control (EXT-1111)
void getAllowedRect(LLRect& rect);
S32 getTongueWidth() { return mDockTongue->getWidth(); }
S32 getTongueHeight() { return mDockTongue->getHeight(); }
private:
virtual void moveDockable();
private:

View File

@ -5033,7 +5033,7 @@
<key>NotificationChannelHeightRatio</key>
<map>
<key>Comment</key>
<string>TODO</string>
<string>Notification channel and World View ratio(0.0 - always show 1 notification, 1.0 - max ratio).</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>

View File

@ -415,6 +415,7 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock)
if(channel)
{
channel->updateShowToastsState();
channel->redrawToasts();
}
}

View File

@ -375,12 +375,6 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel)
}
}
void LLScreenChannel::onVisibleChanged(LLUICtrl* ctrl, const LLSD& param)
{
updateShowToastsState();
redrawToasts();
}
//--------------------------------------------------------------------------
void LLScreenChannel::redrawToasts()
{
@ -446,17 +440,11 @@ void LLScreenChannel::showToastsBottom()
if( !(*it).toast->getVisible() )
{
if((*it).toast->isFirstLook())
{
(*it).toast->setVisible(TRUE);
}
else
{
// HACK
// EXT-2653: it is necessary to prevent overlapping for secondary showed toasts
(*it).toast->setVisible(TRUE);
gFloaterView->sendChildToBack((*it).toast);
}
// HACK
// EXT-2653: it is necessary to prevent overlapping for secondary showed toasts
(*it).toast->setVisible(TRUE);
// Show toast behind floaters. (EXT-3089)
gFloaterView->sendChildToBack((*it).toast);
}
}
@ -774,7 +762,7 @@ void LLScreenChannel::onToastHover(LLToast* toast, bool mouse_enter)
//--------------------------------------------------------------------------
void LLScreenChannel::updateShowToastsState()
{
LLFloater* floater = LLDockableFloater::getInstanceHandle().get();
LLDockableFloater* floater = dynamic_cast<LLDockableFloater*>(LLDockableFloater::getInstanceHandle().get());
if(!floater)
{
@ -791,7 +779,8 @@ void LLScreenChannel::updateShowToastsState()
LLRect this_rect = getRect();
if(floater->getVisible() && floater->isDocked())
{
channel_bottom = floater->getRect().mTop + gSavedSettings.getS32("ToastGap");
channel_bottom += floater->getRect().getHeight();
channel_bottom += floater->getDockControl()->getTongueHeight();
}
if(channel_bottom != this_rect.mBottom)

View File

@ -265,6 +265,9 @@ private:
// create the StartUp Toast
void createStartUpToast(S32 notif_num, F32 timer);
/**
* Notification channel and World View ratio(0.0 - always show 1 notification, 1.0 - max ratio).
*/
static F32 getHeightRatio();
// Channel's flags

View File

@ -189,6 +189,7 @@ void LLSysWellWindow::setDocked(bool docked, bool pop_on_undock)
if(mChannel)
{
mChannel->updateShowToastsState();
mChannel->redrawToasts();
}
}