From 4b9abb162cd7b4cfca3c98a0611cb2272d336476 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Wed, 27 Jan 2010 18:05:46 +0200 Subject: fixed minor bug EXT-3941 Quick clicks on chiclets are treated as double clicks Handling of mouseDown event was delegated to chiclet's button. Also double callback was connected with onMouseDown handler to ride from missed click behavior. --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 26 ++++++++------------------ indra/newview/llchiclet.h | 17 ++++------------- 2 files changed, 12 insertions(+), 31 deletions(-) (limited to 'indra') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index f1de4e2982..f646bcccb5 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -459,6 +459,14 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) enableCounterControl(p.enable_counter); } +/* virtual*/ +BOOL LLIMChiclet::postBuild() +{ + mChicletButton = getChild("chiclet_button"); + mChicletButton->setCommitCallback(boost::bind(&LLIMChiclet::onMouseDown, this)); + mChicletButton->setDoubleClickCallback(boost::bind(&LLIMChiclet::onMouseDown, this)); + return TRUE; +} void LLIMChiclet::setShowSpeaker(bool show) { bool needs_resize = getShowSpeaker() != show; @@ -583,12 +591,6 @@ void LLIMChiclet::setToggleState(bool toggle) mChicletButton->setToggleState(toggle); } -BOOL LLIMChiclet::handleMouseDown(S32 x, S32 y, MASK mask) -{ - onMouseDown(); - return LLChiclet::handleMouseDown(x, y, mask); -} - void LLIMChiclet::draw() { LLUICtrl::draw(); @@ -1905,12 +1907,6 @@ void LLScriptChiclet::onMouseDown() LLScriptFloaterManager::getInstance()->toggleScriptFloater(getSessionId()); } -BOOL LLScriptChiclet::handleMouseDown(S32 x, S32 y, MASK mask) -{ - onMouseDown(); - return LLChiclet::handleMouseDown(x, y, mask); -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -1975,10 +1971,4 @@ void LLInvOfferChiclet::onMouseDown() LLScriptFloaterManager::instance().toggleScriptFloater(getSessionId()); } -BOOL LLInvOfferChiclet::handleMouseDown(S32 x, S32 y, MASK mask) -{ - onMouseDown(); - return LLChiclet::handleMouseDown(x, y, mask); -} - // EOF diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index bb4846aa57..b006ae3420 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -327,6 +327,10 @@ public: virtual ~LLIMChiclet() {}; + /** + * It is used for default setting up of chicklet:click handler, etc. + */ + BOOL postBuild(); /** * Sets IM session name. This name will be displayed in chiclet tooltip. */ @@ -428,8 +432,6 @@ protected: LLIMChiclet(const LLIMChiclet::Params& p); - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - protected: bool mShowSpeaker; @@ -640,11 +642,6 @@ public: */ /*virtual*/ void onMouseDown(); - /** - * Override default handler - */ - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - protected: LLScriptChiclet(const Params&); @@ -684,12 +681,6 @@ public: */ /*virtual*/ void onMouseDown(); - /** - * Override default handler - */ - /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - - protected: LLInvOfferChiclet(const Params&); friend class LLUICtrlFactory; -- cgit v1.2.3