summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychathandler.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2010-12-04 13:07:51 +0200
committerVadim ProductEngine <vsavchuk@productengine.com>2010-12-04 13:07:51 +0200
commitb9fa0e9bbe0db5ecdfb5fbdd88474e0d3bb8eed2 (patch)
tree11d22fbc694ed084e707198fd72c4179091f7b2a /indra/newview/llnearbychathandler.cpp
parentd0ec374e15c5a5a8edf59441d8b8350daeb8285b (diff)
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".
Diffstat (limited to 'indra/newview/llnearbychathandler.cpp')
-rw-r--r--indra/newview/llnearbychathandler.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index d2ad78f140..dfbbaa0941 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -165,11 +165,20 @@ public:
: LLToast(p),
mNearbyChatScreenChannelp(nc_channelp)
{
+ updateTransparency();
+ setMouseEnterCallback(boost::bind(&LLNearbyChatToast::updateTransparency, this));
+ setMouseLeaveCallback(boost::bind(&LLNearbyChatToast::updateTransparency, this));
}
/*virtual*/ void onClose(bool app_quitting);
+ /*virtual*/ void setBackgroundOpaque(BOOL b);
+
+protected:
+ /*virtual*/ void setTransparentState(bool transparent);
private:
+ void updateTransparency();
+
LLNearbyChatScreenChannel* mNearbyChatScreenChannelp;
};
@@ -597,4 +606,34 @@ void LLNearbyChatToast::onClose(bool 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