Skip to content
Snippets Groups Projects
Commit b9fa0e9b authored by Vadim ProductEngine's avatar Vadim ProductEngine
Browse files

STORM-717 FIXED Made nearby chat toasts respect transparency settings:

* Normally toasts are as opaque as specified by "inactive floater opacity" setting.
* When mouse is hovering a toast, the toast uses "active floater opacity" setting.
* Fading toasts have 1/2 of "inactive floater opacity".
parent d0ec374e
No related branches found
No related tags found
No related merge requests found
...@@ -944,6 +944,10 @@ F32 LLUICtrl::getCurrentTransparency() ...@@ -944,6 +944,10 @@ F32 LLUICtrl::getCurrentTransparency()
case TT_INACTIVE: case TT_INACTIVE:
alpha = sInactiveControlTransparency; alpha = sInactiveControlTransparency;
break; break;
case TT_FADING:
alpha = sInactiveControlTransparency / 2;
break;
} }
return alpha; return alpha;
......
...@@ -123,8 +123,9 @@ class LLUICtrl ...@@ -123,8 +123,9 @@ class LLUICtrl
enum ETypeTransparency enum ETypeTransparency
{ {
TT_DEFAULT, TT_DEFAULT,
TT_ACTIVE, TT_ACTIVE, // focused floater
TT_INACTIVE TT_INACTIVE, // other floaters
TT_FADING, // fading toast
}; };
/*virtual*/ ~LLUICtrl(); /*virtual*/ ~LLUICtrl();
......
...@@ -165,11 +165,20 @@ class LLNearbyChatToast : public LLToast ...@@ -165,11 +165,20 @@ class LLNearbyChatToast : public LLToast
: LLToast(p), : LLToast(p),
mNearbyChatScreenChannelp(nc_channelp) mNearbyChatScreenChannelp(nc_channelp)
{ {
updateTransparency();
setMouseEnterCallback(boost::bind(&LLNearbyChatToast::updateTransparency, this));
setMouseLeaveCallback(boost::bind(&LLNearbyChatToast::updateTransparency, this));
} }
/*virtual*/ void onClose(bool app_quitting); /*virtual*/ void onClose(bool app_quitting);
/*virtual*/ void setBackgroundOpaque(BOOL b);
protected:
/*virtual*/ void setTransparentState(bool transparent);
private: private:
void updateTransparency();
LLNearbyChatScreenChannel* mNearbyChatScreenChannelp; LLNearbyChatScreenChannel* mNearbyChatScreenChannelp;
}; };
...@@ -597,4 +606,34 @@ void LLNearbyChatToast::onClose(bool app_quitting) ...@@ -597,4 +606,34 @@ void LLNearbyChatToast::onClose(bool app_quitting)
mNearbyChatScreenChannelp->onToastDestroyed(this, app_quitting); mNearbyChatScreenChannelp->onToastDestroyed(this, app_quitting);
} }
// virtual
void LLNearbyChatToast::setBackgroundOpaque(BOOL b)
{
// We don't want background changes: transparency is handled differently.
LLToast::setBackgroundOpaque(TRUE);
}
// virtual
void LLNearbyChatToast::setTransparentState(bool transparent)
{
LLToast::setTransparentState(transparent);
updateTransparency();
}
void LLNearbyChatToast::updateTransparency()
{
ETypeTransparency transparency_type;
if (isHovered())
{
transparency_type = TT_ACTIVE;
}
else
{
transparency_type = getTransparentState() ? TT_FADING : TT_INACTIVE;
}
LLFloater::updateTransparency(transparency_type);
}
// EOF // EOF
...@@ -141,7 +141,7 @@ class LLToast : public LLModalDialog ...@@ -141,7 +141,7 @@ class LLToast : public LLModalDialog
// //
virtual void setVisible(BOOL show); virtual void setVisible(BOOL show);
/*virtual*/ void setBackgroundOpaque(BOOL b); virtual void setBackgroundOpaque(BOOL b);
// //
virtual void hide(); virtual void hide();
...@@ -198,6 +198,10 @@ class LLToast : public LLModalDialog ...@@ -198,6 +198,10 @@ class LLToast : public LLModalDialog
LLHandle<LLToast> getHandle() { mHandle.bind(this); return mHandle; } LLHandle<LLToast> getHandle() { mHandle.bind(this); return mHandle; }
bool getTransparentState() const { return mIsTransparent; }
virtual void setTransparentState(bool transparent);
private: private:
void onToastMouseEnter(); void onToastMouseEnter();
...@@ -206,8 +210,6 @@ class LLToast : public LLModalDialog ...@@ -206,8 +210,6 @@ class LLToast : public LLModalDialog
void expire(); void expire();
void setTransparentState(bool transparent);
LLUUID mNotificationID; LLUUID mNotificationID;
LLUUID mSessionID; LLUUID mSessionID;
LLNotificationPtr mNotification; LLNotificationPtr mNotification;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment