diff options
Diffstat (limited to 'indra/newview/llchiclet.cpp')
-rw-r--r-- | indra/newview/llchiclet.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index fd91da2de2..433f70700c 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -56,6 +56,7 @@ static LLDefaultChildRegistry::Register<LLNotificationChiclet> t2("chiclet_notif static LLDefaultChildRegistry::Register<LLIMP2PChiclet> t3("chiclet_im_p2p"); static LLDefaultChildRegistry::Register<LLIMGroupChiclet> t4("chiclet_im_group"); static LLDefaultChildRegistry::Register<LLAdHocChiclet> t5("chiclet_im_adhoc"); +static LLDefaultChildRegistry::Register<LLScriptChiclet> t6("chiclet_script"); static const LLRect CHICLET_RECT(0, 25, 25, 0); static const LLRect CHICLET_ICON_RECT(0, 22, 22, 0); @@ -1418,24 +1419,21 @@ LLChicletSpeakerCtrl::LLChicletSpeakerCtrl(const Params&p) ////////////////////////////////////////////////////////////////////////// LLScriptChiclet::Params::Params() - : avatar_icon("avatar_icon") + : icon("icon") { // *TODO Vadim: Get rid of hardcoded values. - rect(CHICLET_RECT); - name("dialog_chiclet"); - - avatar_icon.name("avatar_icon"); - avatar_icon.follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_BOTTOM); - - avatar_icon.rect(CHICLET_ICON_RECT); - avatar_icon.mouse_opaque(false); + rect(CHICLET_RECT); + icon.rect(CHICLET_ICON_RECT); } LLScriptChiclet::LLScriptChiclet(const Params&p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) { - mImage = LLUI::getUIImage("Generic_Object_Small"); + LLIconCtrl::Params icon_params = p.icon; + mChicletIconCtrl = LLUICtrlFactory::create<LLIconCtrl>(icon_params); + // Let "new message" icon be on top, else it will be hidden behind chiclet icon. + addChildInBack(mChicletIconCtrl); } void LLScriptChiclet::setSessionId(const LLUUID& session_id) @@ -1443,20 +1441,14 @@ void LLScriptChiclet::setSessionId(const LLUUID& session_id) setShowNewMessagesIcon( getSessionId() != session_id ); LLIMChiclet::setSessionId(session_id); - LLNotificationPtr notification = LLNotifications::getInstance()->find( - LLScriptFloaterManager::getInstance()->getNotificationId(session_id)); + LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(session_id); + LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id); if(notification) { setToolTip(notification->getSubstitutions()["TITLE"].asString()); } } -void LLScriptChiclet::draw() -{ - mImage->draw(getLocalRect()); - LLIMChiclet::draw(); -} - void LLScriptChiclet::onMouseDown() { LLScriptFloaterManager::getInstance()->toggleScriptFloater(getSessionId()); @@ -1467,3 +1459,5 @@ BOOL LLScriptChiclet::handleMouseDown(S32 x, S32 y, MASK mask) onMouseDown(); return LLChiclet::handleMouseDown(x, y, mask); } + +// EOF |