diff options
author | Mike Antipov <mantipov@productengine.com> | 2009-12-15 16:41:52 +0200 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2009-12-15 16:41:52 +0200 |
commit | eccc3ed597121ec49ae9a9979200985cc80e9edd (patch) | |
tree | a66e73856b93138cebe07734b8f185aa2fc767c1 /indra/newview | |
parent | 40a10565ac02b5e0b8b34969f92c3e9b5c6b497c (diff) |
Work on task EXT-3147 (Implement new states for message indicators)
-- fixed bug: Well icon leaves in "Unlit" state if new message arrives when it is in the "Lit" state while flashing
Improved behavior of reversing Lit/Unlit states
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llchiclet.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llchiclet.h | 5 |
2 files changed, 17 insertions, 9 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index b27634e105..08782abf0d 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -89,6 +89,14 @@ class LLSysWellChiclet::FlashToLitTimer : public LLEventTimer { public: typedef boost::function<void()> callback_t; + + /** + * Constructor. + * + * @param count - how many times callback should be called (twice to not change original state) + * @param period - how frequently callback should be called + * @param cb - callback to be called each tick + */ FlashToLitTimer(S32 count, F32 period, callback_t cb) : LLEventTimer(period) , mCallback(cb) @@ -119,6 +127,10 @@ public: private: callback_t mCallback; + + /** + * How many times Well will blink. + */ S32 mFlashCount; S32 mCurrentFlashCount; }; @@ -140,6 +152,7 @@ LLSysWellChiclet::LLSysWellChiclet(const Params& p) , mButton(NULL) , mCounter(0) , mMaxDisplayedCount(p.max_displayed_count) +, mIsNewMessagesState(false) , mFlashToLitTimer(NULL) { LLButton::Params button_params = p.button; @@ -198,11 +211,7 @@ void LLSysWellChiclet::setToggleState(BOOL toggled) { void LLSysWellChiclet::changeLitState() { - static bool set_lit = false; - - setNewMessagesState(set_lit); - - set_lit ^= true; + setNewMessagesState(!mIsNewMessagesState); } void LLSysWellChiclet::setNewMessagesState(bool new_messages) @@ -216,6 +225,8 @@ void LLSysWellChiclet::setNewMessagesState(bool new_messages) image_pressed_selected "Lit" + "Selected" - there are new messages and the Well is open */ mButton->setForcePressedState(new_messages); + + mIsNewMessagesState = new_messages; } /************************************************************************/ diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 6228f87252..a2fda483f0 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -811,11 +811,8 @@ protected: LLButton* mButton; S32 mCounter; S32 mMaxDisplayedCount; + bool mIsNewMessagesState; - /** - * How many times Well will blink. - */ - S32 mFlashToLitCount; FlashToLitTimer* mFlashToLitTimer; }; |