summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Leonhardt <sebastian.leonhardt@web.de>2015-10-21 00:11:44 +0200
committerGerrit Rockbox <gerrit@rockbox.org>2015-11-10 20:40:36 +0100
commita8758c953d50fb020b245d5739c41de113638b49 (patch)
tree3be4fca43688e92afad2633d9310ac99bb6748cd
parentce26212138d53147e3e2e91f7b864d5deada344f (diff)
downloadrockbox-a8758c9.tar.gz
rockbox-a8758c9.tar.bz2
rockbox-a8758c9.zip
Fix scrolling left button inadvertently cancels listtree
Depending on the actual keymap, canceling a listtree with the "scroll left" button may not be intended, especially if the list is entered from a completely different focus (think of leaving a plugin with "long left") Note: initializing "scrolling_left" with true without anything actually scrolling sounds odd to me... maybe this variable should be renamed? "pgleft_allow_cancel" comes to my mind (with opposite boolean states) Change-Id: I58a747fc90e91ae96e75932febb462f1f1a1b4ca
-rw-r--r--apps/gui/list.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 8663abe8a0..eb5f298316 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -625,7 +625,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists,
{
int action = *actionptr;
#ifdef HAVE_LCD_BITMAP
- static bool scrolling_left = false;
+ static bool pgleft_allow_cancel = false;
#endif
#ifdef HAVE_WHEEL_ACCELERATION
@@ -735,24 +735,26 @@ bool gui_synclist_do_button(struct gui_synclist * lists,
to skip to root. ACTION_TREE_ROOT_INIT must be defined in the
keymaps as a repeated button press (the same as the repeated
ACTION_TREE_PGLEFT) with the pre condition being the non-repeated
- button press */
+ button press. Leave out ACTION_TREE_ROOT_INIT in your keymaps to
+ disable cancel action by PGLEFT key (e.g. if PGLEFT and CANCEL
+ are mapped to different keys) */
if (lists->offset_position[0] == 0)
{
- scrolling_left = false;
+ pgleft_allow_cancel = true;
*actionptr = ACTION_STD_CANCEL;
return true;
}
*actionptr = ACTION_TREE_PGLEFT;
case ACTION_TREE_PGLEFT:
- if(!scrolling_left && (lists->offset_position[0] == 0))
+ if(pgleft_allow_cancel && (lists->offset_position[0] == 0))
{
*actionptr = ACTION_STD_CANCEL;
return false;
}
gui_synclist_scroll_left(lists);
gui_synclist_draw(lists);
- scrolling_left = true; /* stop ACTION_TREE_PAGE_LEFT
- skipping to root */
+ pgleft_allow_cancel = false; /* stop ACTION_TREE_PAGE_LEFT
+ skipping to root */
return true;
#endif
/* for pgup / pgdown, we are obliged to have a different behaviour depending