summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llchiclet.cpp25
-rw-r--r--indra/newview/llchiclet.h11
2 files changed, 34 insertions, 2 deletions
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<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;
@@ -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
@@ -831,6 +831,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()
*/
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
@@ -870,6 +880,7 @@ protected:
S32 mScrollingOffset;
S32 mMinWidth;
bool mShowControls;
+ static const S32 s_scroll_ratio;
};
template<class T>