summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2014-01-29 19:11:15 +0100
committerVojtech Bocek <vbocek@gmail.com>2014-01-29 19:15:56 +0100
commit59e51a43497d1d2824b6637f10ca04a86211aacf (patch)
tree315428faf4bfee73a2143c90c5d12db25ff38315
parentFix make file flag name for minzip (diff)
downloadandroid_bootable_recovery-59e51a43497d1d2824b6637f10ca04a86211aacf.tar
android_bootable_recovery-59e51a43497d1d2824b6637f10ca04a86211aacf.tar.gz
android_bootable_recovery-59e51a43497d1d2824b6637f10ca04a86211aacf.tar.bz2
android_bootable_recovery-59e51a43497d1d2824b6637f10ca04a86211aacf.tar.lz
android_bootable_recovery-59e51a43497d1d2824b6637f10ca04a86211aacf.tar.xz
android_bootable_recovery-59e51a43497d1d2824b6637f10ca04a86211aacf.tar.zst
android_bootable_recovery-59e51a43497d1d2824b6637f10ca04a86211aacf.zip
Diffstat (limited to '')
-rw-r--r--gui/fileselector.cpp8
-rw-r--r--gui/listbox.cpp8
2 files changed, 12 insertions, 4 deletions
diff --git a/gui/fileselector.cpp b/gui/fileselector.cpp
index 0f8d903a3..b7804fd86 100644
--- a/gui/fileselector.cpp
+++ b/gui/fileselector.cpp
@@ -659,7 +659,7 @@ int GUIFileSelector::GetSelection(int x, int y)
int GUIFileSelector::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)
@@ -674,6 +674,9 @@ int GUIFileSelector::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:
// Check if we dragged out of the selection window
@@ -687,7 +690,7 @@ int GUIFileSelector::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 = (mShowFolders ? mFolderList.size() : 0) + (mShowFiles ? mFileList.size() : 0);
@@ -761,6 +764,7 @@ int GUIFileSelector::NotifyTouch(TOUCH_STATE state, int x, int y)
case TOUCH_RELEASE:
isHighlighted = false;
+ fastScroll = 0;
if (startSelection >= 0)
{
// We've selected an item!
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!