From 3a8c80a388df64dd58b4dc77e7219dfdd20f4aac Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 10 Nov 2009 18:45:51 +0200 Subject: fixed EXT-2275 "[BSI] New incoming IM or Group IM pushes all existing (and new) chiclets off the right end of the chiclet bar." --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 25 +++++++++++++++++++++++-- indra/newview/llchiclet.h | 11 +++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index fe4859ead0..e5c73dcbef 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -59,6 +59,9 @@ static const LLRect CHICLET_RECT(0, 25, 25, 0); static const LLRect CHICLET_ICON_RECT(0, 24, 24, 0); static const LLRect VOICE_INDICATOR_RECT(25, 25, 45, 0); +// static +const S32 LLChicletPanel::s_scroll_ratio = 10; + S32 LLNotificationChiclet::mUreadSystemNotifications = 0; boost::signals2::signal("chicklet_left_scroll_button"); LLTransientFloaterMgr::getInstance()->addControlView(mLeftScrollButton); - mLeftScrollButton->setClickedCallback(boost::bind(&LLChicletPanel::onLeftScrollClick,this)); + mLeftScrollButton->setMouseDownCallback(boost::bind(&LLChicletPanel::onLeftScrollClick,this)); + mLeftScrollButton->setHeldDownCallback(boost::bind(&LLChicletPanel::onLeftScrollHeldDown,this)); mLeftScrollButton->setEnabled(false); mRightScrollButton=getChild("chicklet_right_scroll_button"); LLTransientFloaterMgr::getInstance()->addControlView(mRightScrollButton); - mRightScrollButton->setClickedCallback(boost::bind(&LLChicletPanel::onRightScrollClick,this)); + mRightScrollButton->setMouseDownCallback(boost::bind(&LLChicletPanel::onRightScrollClick,this)); + mRightScrollButton->setHeldDownCallback(boost::bind(&LLChicletPanel::onRightScrollHeldDown,this)); mRightScrollButton->setEnabled(false); return TRUE; @@ -1220,6 +1225,22 @@ void LLChicletPanel::onRightScrollClick() scrollRight(); } +void LLChicletPanel::onLeftScrollHeldDown() +{ + S32 offset = mScrollingOffset; + mScrollingOffset = mScrollingOffset / s_scroll_ratio; + scrollLeft(); + mScrollingOffset = offset; +} + +void LLChicletPanel::onRightScrollHeldDown() +{ + S32 offset = mScrollingOffset; + mScrollingOffset = mScrollingOffset / s_scroll_ratio; + scrollRight(); + mScrollingOffset = offset; +} + boost::signals2::connection LLChicletPanel::setChicletClickedCallback( const commit_callback_t& cb) { diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 97af82fe2f..e7afd7f08e 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -830,6 +830,16 @@ protected: */ void onRightScrollClick(); + /* + * Callback for right scroll button held down event + */ + void onLeftScrollHeldDown(); + + /* + * Callback for left scroll button held down event + */ + void onRightScrollHeldDown(); + /* * Callback for mouse wheel scrolled, calls scrollRight() or scrollLeft() */ @@ -870,6 +880,7 @@ protected: S32 mScrollingOffset; S32 mMinWidth; bool mShowControls; + static const S32 s_scroll_ratio; }; template -- cgit v1.2.3