From 59e51a43497d1d2824b6637f10ca04a86211aacf Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Wed, 29 Jan 2014 19:11:15 +0100 Subject: Don't switch between fast and normal scroll during drag in listviews Signed-off-by: Vojtech Bocek Change-Id: I925adda7f417c6e578f501babc8ef2bec638f66b --- gui/listbox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gui/listbox.cpp') diff --git a/gui/listbox.cpp b/gui/listbox.cpp index a4976f4e1..670966401 100644 --- a/gui/listbox.cpp +++ b/gui/listbox.cpp @@ -602,7 +602,7 @@ int GUIListBox::GetSelection(int x, int y) int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y) { - static int lastY = 0, last2Y = 0; + static int lastY = 0, last2Y = 0, fastScroll = 0; int selection = 0; switch (state) @@ -617,6 +617,9 @@ int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y) mUpdate = 1; startY = lastY = last2Y = y; scrollingSpeed = 0; + + if(mFastScrollRectX != -1 && x >= mRenderX + mRenderW - mFastScrollW) + fastScroll = 1; break; case TOUCH_DRAG: @@ -631,7 +634,7 @@ int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y) } // Fast scroll - if(mFastScrollRectX != -1 && x >= mRenderX + mRenderW - mFastScrollW) + if(fastScroll) { int pct = ((y-mRenderY-mHeaderH)*100)/(mRenderH-mHeaderH); int totalSize = mList.size(); @@ -705,6 +708,7 @@ int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y) case TOUCH_RELEASE: isHighlighted = false; + fastScroll = 0; if (startSelection >= 0) { // We've selected an item! -- cgit v1.2.3