diff options
author | Yuri Chebotarev <ychebotarev@productengine.com> | 2009-11-10 20:13:17 +0200 |
---|---|---|
committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2009-11-10 20:13:17 +0200 |
commit | ebbca6470aa04c29712d92f6b52467188663e055 (patch) | |
tree | 13b62d698ebc48d9efa1d65991744c71f9ff407e /indra/newview/llchiclet.cpp | |
parent | f15767bbef4e0a87aa032e265b3a0a8d4db907e1 (diff) | |
parent | c673ef4a913691cea8e94b688937084edb821f68 (diff) |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llchiclet.cpp')
-rw-r--r-- | indra/newview/llchiclet.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index fe4859ead0..5402f88cd3 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<LLChiclet* (const LLUUID&), @@ -856,12 +859,14 @@ BOOL LLChicletPanel::postBuild() mLeftScrollButton=getChild<LLButton>("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<LLButton>("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; @@ -1047,8 +1052,8 @@ void LLChicletPanel::reshape(S32 width, S32 height, BOOL called_from_parent ) mLeftScrollButton->setRect(LLRect(0,scroll_button_rect.mTop,scroll_button_rect.getWidth(), scroll_button_rect.mBottom)); scroll_button_rect = mRightScrollButton->getRect(); - mRightScrollButton->setRect(LLRect(width - scroll_button_rect.getWidth(),scroll_button_rect.mTop,
- width, scroll_button_rect.mBottom));
+ mRightScrollButton->setRect(LLRect(width - scroll_button_rect.getWidth(),scroll_button_rect.mTop, + width, scroll_button_rect.mBottom)); mScrollArea->setRect(LLRect(scroll_button_rect.getWidth() + SCROLL_BUTTON_PAD, height, width - scroll_button_rect.getWidth() - SCROLL_BUTTON_PAD, 0)); mShowControls = width > mMinWidth; @@ -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) { |