summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/lluictrl.cpp4
-rw-r--r--indra/llui/lluictrl.h5
-rw-r--r--indra/newview/llnearbychathandler.cpp39
-rw-r--r--indra/newview/lltoast.h8
4 files changed, 51 insertions, 5 deletions
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 7e4cb78d80..afd60cbb3e 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -944,6 +944,10 @@ F32 LLUICtrl::getCurrentTransparency()
case TT_INACTIVE:
alpha = sInactiveControlTransparency;
break;
+
+ case TT_FADING:
+ alpha = sInactiveControlTransparency / 2;
+ break;
}
return alpha;
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index a78f98ac76..b37e9f6b1b 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -123,8 +123,9 @@ public:
enum ETypeTransparency
{
TT_DEFAULT,
- TT_ACTIVE,
- TT_INACTIVE
+ TT_ACTIVE, // focused floater
+ TT_INACTIVE, // other floaters
+ TT_FADING, // fading toast
};
/*virtual*/ ~LLUICtrl();
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
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index f88c628631..d23e858c5c 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -141,7 +141,7 @@ public:
//
virtual void setVisible(BOOL show);
- /*virtual*/ void setBackgroundOpaque(BOOL b);
+ virtual void setBackgroundOpaque(BOOL b);
//
virtual void hide();
@@ -198,6 +198,10 @@ public:
LLHandle<LLToast> getHandle() { mHandle.bind(this); return mHandle; }
+ bool getTransparentState() const { return mIsTransparent; }
+ virtual void setTransparentState(bool transparent);
+
+
private:
void onToastMouseEnter();
@@ -206,8 +210,6 @@ private:
void expire();
- void setTransparentState(bool transparent);
-
LLUUID mNotificationID;
LLUUID mSessionID;
LLNotificationPtr mNotification;