From b2a6f4853b550af68a6f4487db00663639e20b38 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Tue, 26 Oct 2010 18:15:30 +0300 Subject: STORM-36 FIXED As a User, I want to control how long a chat toast appears before it fades. Please add fade time back to Chat preferences. - Added two spinners to the Chat preferences tab that control NearbyToastLifeTime and NearbyToastFadingTime - Added callbacks to the LLNearbyChatScreenChannel that update these properties if they were changed Refactoring of LLToast: - Removed code that was making toast transparent from LLToast::draw() - Modified LLToast interface that relates to showing and hiding toast, so that all screen channels can use LLToast universally. - Replaced in LLScreenChannel calling methods of old interface to new ones. --- indra/newview/lltoast.h | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'indra/newview/lltoast.h') diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 0a96c092a0..fb534561c9 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -49,14 +49,16 @@ class LLToast; class LLToastLifeTimer: public LLEventTimer { public: - LLToastLifeTimer(LLToast* toast, F32 period) : mToast(toast), LLEventTimer(period){} + LLToastLifeTimer(LLToast* toast, F32 period); /*virtual*/ BOOL tick(); - void stop() { mEventTimer.stop(); } - void start() { mEventTimer.start(); } - void restart() {mEventTimer.reset(); } - BOOL getStarted() { return mEventTimer.getStarted(); } + void stop(); + void start(); + void restart(); + BOOL getStarted(); + void setPeriod(F32 period); + F32 getRemainingTimeF32(); LLTimer& getEventTimer() { return mEventTimer;} private : @@ -80,8 +82,14 @@ public: Optional notif_id, //notification ID session_id; //im session ID Optional notification; - Optional lifetime_secs, - fading_time_secs; // Number of seconds while a toast is fading + + //NOTE: Life time of a toast (i.e. period of time from the moment toast was shown + //till the moment when toast was hidden) is the sum of lifetime_secs and fading_time_secs. + + Optional lifetime_secs, // Number of seconds while a toast is non-transparent + fading_time_secs; // Number of seconds while a toast is transparent + + Optional on_delete_toast, on_mouse_enter; Optional can_fade, @@ -125,10 +133,8 @@ public: LLPanel* getPanel() { return mPanel; } // enable/disable Toast's Hide button void setHideButtonEnabled(bool enabled); - // - void resetTimer() { mTimer->start(); } // - void stopTimer() { mTimer->stop(); } + F32 getTimeLeftToLive(); // LLToastLifeTimer* getTimer() { return mTimer.get();} // @@ -144,6 +150,10 @@ public: /*virtual*/ void onFocusReceived(); + void setLifetime(S32 seconds); + + void setFadingTime(S32 seconds); + /** * Returns padding between floater top and wrapper_panel top. * This padding should be taken into account when positioning or reshaping toasts @@ -196,7 +206,9 @@ private: void onToastMouseLeave(); - void expire(); + void expire(); + + void setTransparentState(bool transparent); LLUUID mNotificationID; LLUUID mSessionID; @@ -222,6 +234,7 @@ private: bool mHideBtnPressed; bool mIsHidden; // this flag is TRUE when a toast has faded or was hidden with (x) button (EXT-1849) bool mIsTip; + bool mIsTransparent; commit_signal_t mToastMouseEnterSignal; commit_signal_t mToastMouseLeaveSignal; -- cgit v1.2.3 From d0ec374e15c5a5a8edf59441d8b8350daeb8285b Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Sat, 4 Dec 2010 12:15:47 +0200 Subject: STORM-717 WIP Cleanup: removed unused on_mouse_enter callback from LLToast. --- indra/newview/lltoast.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview/lltoast.h') diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index fb534561c9..f88c628631 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -90,8 +90,7 @@ public: fading_time_secs; // Number of seconds while a toast is transparent - Optional on_delete_toast, - on_mouse_enter; + Optional on_delete_toast; Optional can_fade, can_be_stored, enable_hide_btn, @@ -182,7 +181,6 @@ public: // Registers signals/callbacks for events toast_signal_t mOnFadeSignal; - toast_signal_t mOnMouseEnterSignal; toast_signal_t mOnDeleteToastSignal; toast_signal_t mOnToastDestroyedSignal; boost::signals2::connection setOnFadeCallback(toast_callback_t cb) { return mOnFadeSignal.connect(cb); } -- cgit v1.2.3 From b9fa0e9bbe0db5ecdfb5fbdd88474e0d3bb8eed2 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Sat, 4 Dec 2010 13:07:51 +0200 Subject: 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". --- indra/newview/lltoast.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/lltoast.h') 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 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; -- cgit v1.2.3 From f3d65643e533472c593ef013b4bb1dd644b85806 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 9 Dec 2010 17:30:18 +0200 Subject: STORM-774 WIP Partially reverted transparency fix for nearby chat toasts (STORM-717) to develop a more generic one (applicable to all notification toasts). --- indra/newview/lltoast.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/newview/lltoast.h') diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index d23e858c5c..f88c628631 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,10 +198,6 @@ public: LLHandle getHandle() { mHandle.bind(this); return mHandle; } - bool getTransparentState() const { return mIsTransparent; } - virtual void setTransparentState(bool transparent); - - private: void onToastMouseEnter(); @@ -210,6 +206,8 @@ private: void expire(); + void setTransparentState(bool transparent); + LLUUID mNotificationID; LLUUID mSessionID; LLNotificationPtr mNotification; -- cgit v1.2.3 From c78db88d060df662ee3590232ef0b9becdcf9d81 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 9 Dec 2010 17:30:31 +0200 Subject: STORM-774 WIP Misc renames to improve readability. --- indra/newview/lltoast.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/lltoast.h') diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index f88c628631..20aa5888b7 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -114,11 +114,11 @@ public: //Fading - /** Stop fading timer */ - virtual void stopFading(); + /** Stop lifetime/fading timer */ + virtual void stopTimer(); - /** Start fading timer */ - virtual void startFading(); + /** Start lifetime/fading timer */ + virtual void startTimer(); bool isHovered(); @@ -206,7 +206,7 @@ private: void expire(); - void setTransparentState(bool transparent); + void setFading(bool fading); LLUUID mNotificationID; LLUUID mSessionID; @@ -232,7 +232,7 @@ private: bool mHideBtnPressed; bool mIsHidden; // this flag is TRUE when a toast has faded or was hidden with (x) button (EXT-1849) bool mIsTip; - bool mIsTransparent; + bool mIsFading; commit_signal_t mToastMouseEnterSignal; commit_signal_t mToastMouseLeaveSignal; -- cgit v1.2.3 From 0308dbeda7645061e780db2bdb7dbdb0069faf67 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 9 Dec 2010 17:30:31 +0200 Subject: STORM-774 FIXED Made notification toasts (e.g. IM 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". --- indra/newview/lltoast.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/lltoast.h') diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 20aa5888b7..242f786bf2 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -198,6 +198,9 @@ public: LLHandle getHandle() { mHandle.bind(this); return mHandle; } +protected: + void updateTransparency(); + private: void onToastMouseEnter(); -- cgit v1.2.3