fix for normal EXT-3763 URL clicked on nearby chat toast opens chat history, not URL in browser.

also move real action from mouse_down to mouse_up (since clicking on url is processing in mouse_up).

--HG--
branch : product-engine
meow-7.2.2
Yuri Chebotarev 2010-01-04 15:42:18 +02:00
parent e673fdea3f
commit 0782f64b64
2 changed files with 26 additions and 3 deletions

View File

@ -253,12 +253,34 @@ void LLNearbyChatToastPanel::onMouseEnter (S32 x, S32 y, MASK mask)
BOOL LLNearbyChatToastPanel::handleMouseDown (S32 x, S32 y, MASK mask)
{
if(mSourceType != CHAT_SOURCE_AGENT)
return LLPanel::handleMouseDown(x,y,mask);
LLFloaterReg::showInstance("nearby_chat",LLSD());
return LLPanel::handleMouseDown(x,y,mask);
}
BOOL LLNearbyChatToastPanel::handleMouseUp (S32 x, S32 y, MASK mask)
{
if(mSourceType != CHAT_SOURCE_AGENT)
return LLPanel::handleMouseUp(x,y,mask);
LLChatMsgBox* text_box = getChild<LLChatMsgBox>("msg_text", false);
S32 local_x = x - text_box->getRect().mLeft;
S32 local_y = y - text_box->getRect().mBottom;
//if text_box process mouse up (ussually this is click on url) - we didn't show nearby_chat.
if (text_box->pointInView(local_x, local_y) )
{
if (text_box->handleMouseUp(local_x,local_y,mask) == TRUE)
return TRUE;
else
{
LLFloaterReg::showInstance("nearby_chat",LLSD());
return FALSE;
}
}
LLFloaterReg::showInstance("nearby_chat",LLSD());
return LLPanel::handleMouseUp(x,y,mask);
}
void LLNearbyChatToastPanel::setHeaderVisibility(EShowItemHeader e)
{
LLUICtrl* icon = getChild<LLUICtrl>("avatar_icon", false);

View File

@ -68,6 +68,7 @@ public:
void onMouseLeave (S32 x, S32 y, MASK mask);
void onMouseEnter (S32 x, S32 y, MASK mask);
BOOL handleMouseDown (S32 x, S32 y, MASK mask);
BOOL handleMouseUp (S32 x, S32 y, MASK mask);
virtual BOOL postBuild();