STORM-682 FIXED Fixed positioning notification toasts in mouse-look mode.

Toasts were positioned as if side tray was expanded.

The fix is to reshape the so-called toasts screen channel (an area where toasts are drawn)
on entering/leaving mouse-look mode, so that the screen channel can notice that side tray get in/visible.
master
Vadim ProductEngine 2010-12-24 20:20:26 +02:00
parent 265616ca02
commit f644ef0fb0
6 changed files with 45 additions and 29 deletions

View File

@ -470,7 +470,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id)
}
//static
bool LLIMFloater::resetAllowedRectPadding(const LLSD& newvalue)
bool LLIMFloater::resetAllowedRectPadding()
{
//reset allowed rect right padding if "SidebarCameraMovement" option
//or sidebar state changed
@ -482,10 +482,10 @@ void LLIMFloater::getAllowedRect(LLRect& rect)
{
if (sAllowedRectRightPadding == RECT_PADDING_NOT_INIT) //wasn't initialized
{
gSavedSettings.getControl("SidebarCameraMovement")->getSignal()->connect(boost::bind(&LLIMFloater::resetAllowedRectPadding, _2));
gSavedSettings.getControl("SidebarCameraMovement")->getSignal()->connect(boost::bind(&LLIMFloater::resetAllowedRectPadding));
LLSideTray* side_bar = LLSideTray::getInstance();
side_bar->getCollapseSignal().connect(boost::bind(&LLIMFloater::resetAllowedRectPadding, _2));
side_bar->setVisibleWidthChangeCallback(boost::bind(&LLIMFloater::resetAllowedRectPadding));
sAllowedRectRightPadding = RECT_PADDING_NEED_RECALC;
}
@ -500,10 +500,7 @@ void LLIMFloater::getAllowedRect(LLRect& rect)
if (gSavedSettings.getBOOL("SidebarCameraMovement") == FALSE)
{
LLSideTray* side_bar = LLSideTray::getInstance();
if (side_bar->getVisible() && !side_bar->getCollapsed())
sAllowedRectRightPadding += side_bar->getRect().getWidth();
sAllowedRectRightPadding += LLSideTray::getInstance()->getVisibleWidth();
}
}
rect.mRight -= sAllowedRectRightPadding;

View File

@ -156,7 +156,7 @@ private:
static void closeHiddenIMToasts();
static bool resetAllowedRectPadding(const LLSD& newvalue);
static bool resetAllowedRectPadding();
//need to keep this static for performance issues
static S32 sAllowedRectRightPadding;

View File

@ -83,11 +83,10 @@ bool LLScreenChannelBase::isHovering()
return mHoveredToast->isHovered();
}
bool LLScreenChannelBase::resetPositionAndSize(const LLSD& newvalue)
void LLScreenChannelBase::resetPositionAndSize()
{
LLRect rc = gViewerWindow->getWorldViewRectScaled();
updatePositionAndSize(rc, rc);
return true;
}
void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect)
@ -99,10 +98,7 @@ void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect ne
if (gSavedSettings.getBOOL("SidebarCameraMovement") == FALSE
&& LLSideTray::instanceCreated ())
{
LLSideTray* side_bar = LLSideTray::getInstance();
if (side_bar->getVisible() && !side_bar->getCollapsed())
world_rect_padding += side_bar->getRect().getWidth();
world_rect_padding += LLSideTray::getInstance()->getVisibleWidth();
}
@ -133,7 +129,7 @@ void LLScreenChannelBase::init(S32 channel_left, S32 channel_right)
if(LLSideTray::instanceCreated())
{
LLSideTray* side_bar = LLSideTray::getInstance();
side_bar->getCollapseSignal().connect(boost::bind(&LLScreenChannelBase::resetPositionAndSize, this, _2));
side_bar->setVisibleWidthChangeCallback(boost::bind(&LLScreenChannelBase::resetPositionAndSize, this));
}
// top and bottom set by updateBottom()
@ -214,10 +210,7 @@ void LLScreenChannel::updatePositionAndSize(LLRect old_world_rect, LLRect new_wo
if (gSavedSettings.getBOOL("SidebarCameraMovement") == FALSE
&& LLSideTray::instanceCreated ())
{
LLSideTray* side_bar = LLSideTray::getInstance();
if (side_bar->getVisible() && !side_bar->getCollapsed())
world_rect_padding += side_bar->getRect().getWidth();
world_rect_padding += LLSideTray::getInstance()->getVisibleWidth();
}

View File

@ -59,8 +59,8 @@ public:
// Channel's outfit-functions
// update channel's size and position in the World View
virtual void updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect);
void resetPositionAndSize();
bool resetPositionAndSize(const LLSD& newvalue);
// initialization of channel's shape and position
virtual void init(S32 channel_left, S32 channel_right);

View File

@ -561,7 +561,7 @@ BOOL LLSideTray::postBuild()
{
if ((*it).channel)
{
getCollapseSignal().connect(boost::bind(&LLScreenChannelBase::resetPositionAndSize, (*it).channel, _2));
setVisibleWidthChangeCallback(boost::bind(&LLScreenChannelBase::resetPositionAndSize, (*it).channel));
}
}
@ -980,9 +980,6 @@ void LLSideTray::reflectCollapseChange()
}
gFloaterView->refresh();
LLSD new_value = mCollapsed;
mCollapseSignal(this,new_value);
}
void LLSideTray::arrange()
@ -1262,9 +1259,29 @@ bool LLSideTray::isPanelActive(const std::string& panel_name)
void LLSideTray::updateSidetrayVisibility()
{
// set visibility of parent container based on collapsed state
if (getParent())
LLView* parent = getParent();
if (parent)
{
getParent()->setVisible(!mCollapsed && !gAgentCamera.cameraMouselook());
bool old_visibility = parent->getVisible();
bool new_visibility = !mCollapsed && !gAgentCamera.cameraMouselook();
if (old_visibility != new_visibility)
{
parent->setVisible(new_visibility);
// Signal change of visible width.
llinfos << "Visible: " << new_visibility << llendl;
mVisibleWidthChangeSignal(this, new_visibility);
}
}
}
S32 LLSideTray::getVisibleWidth()
{
return (isInVisibleChain() && !mCollapsed) ? getRect().getWidth() : 0;
}
void LLSideTray::setVisibleWidthChangeCallback(const commit_signal_t::slot_type& cb)
{
mVisibleWidthChangeSignal.connect(cb);
}

View File

@ -165,9 +165,18 @@ public:
void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE);
void updateSidetrayVisibility();
/**
* @return side tray width if it's visible and expanded, 0 otherwise.
*
* Not that width of the tab buttons is not included.
*
* @see setVisibleWidthChangeCallback()
*/
S32 getVisibleWidth();
commit_signal_t& getCollapseSignal() { return mCollapseSignal; }
void setVisibleWidthChangeCallback(const commit_signal_t::slot_type& cb);
void updateSidetrayVisibility();
void handleLoginComplete();
@ -216,7 +225,7 @@ private:
tab_order_vector_t mOriginalTabOrder;
LLSideTrayTab* mActiveTab;
commit_signal_t mCollapseSignal;
commit_signal_t mVisibleWidthChangeSignal;
LLButton* mCollapseButton;
bool mCollapsed;