diff options
author | Eugene Mutavchi <emutavchi@productengine.com> | 2009-12-11 22:49:16 +0200 |
---|---|---|
committer | Eugene Mutavchi <emutavchi@productengine.com> | 2009-12-11 22:49:16 +0200 |
commit | 612c7a2960492a7838b55dd3706a3ddcec0d0c30 (patch) | |
tree | e3be64ee32e5c4f564742458c9671b28767669f1 /indra/newview | |
parent | b2badcaf695304847312445d9b9184958d705fe1 (diff) |
Additional commit for normal sub-task EXT-3142("new message" indicator for object chiclets)
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llscriptfloater.cpp | 29 | ||||
-rw-r--r-- | indra/newview/llscriptfloater.h | 5 |
2 files changed, 32 insertions, 2 deletions
diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 5c4f6e8860..9884aec2e3 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -66,6 +66,7 @@ LLScriptFloater::LLScriptFloater(const LLSD& key) : LLDockableFloater(NULL, true, key) , mScriptForm(NULL) { + setMouseDownCallback(boost::bind(&LLScriptFloater::onMouseDown, this)); } bool LLScriptFloater::toggle(const LLUUID& object_id) @@ -180,6 +181,23 @@ void LLScriptFloater::setVisible(BOOL visible) hideToastsIfNeeded(); } +void LLScriptFloater::onMouseDown() +{ + if(getObjectId().notNull()) + { + // Remove new message icon + LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getObjectId()); + if (chiclet == NULL) + { + llerror("Dock chiclet for LLScriptFloater doesn't exist", 0); + } + else + { + chiclet->setShowNewMessagesIcon(false); + } + } +} + void LLScriptFloater::hideToastsIfNeeded() { using namespace LLNotificationsUI; @@ -217,11 +235,18 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) script_notification_map_t::iterator it = mNotifications.find(object_id); if(it != mNotifications.end()) { + LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(object_id); + if(chiclet) + { + // Pass the new_message icon state further. + set_new_message = chiclet->getShowNewMessagesIcon(); + } + LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", it->second.notification_id); if(floater) { - // Generate chiclet with a "new message" indicator if a docked window was opened. See EXT-3142. - set_new_message = floater->isShown(); + // Generate chiclet with a "new message" indicator if a docked window was opened but not in focus. See EXT-3142. + set_new_message |= !floater->hasFocus(); } onRemoveNotification(it->second.notification_id); diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index 95ec5a4d9c..ed10dc5fe9 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -169,6 +169,11 @@ protected: */ static void hideToastsIfNeeded(); + /** + * Removes chiclets new messages icon + */ + void onMouseDown(); + private: LLToastNotifyPanel* mScriptForm; LLUUID mObjectId; |