summaryrefslogtreecommitdiff
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-a8758c953d50fb020b245d5739c41de113638b49.tar.gz
rockbox-a8758c953d50fb020b245d5739c41de113638b49.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,
625{ 625{
626 int action = *actionptr; 626 int action = *actionptr;
627#ifdef HAVE_LCD_BITMAP 627#ifdef HAVE_LCD_BITMAP
628 static bool scrolling_left = false; 628 static bool pgleft_allow_cancel = false;
629#endif 629#endif
630 630
631#ifdef HAVE_WHEEL_ACCELERATION 631#ifdef HAVE_WHEEL_ACCELERATION
@@ -735,24 +735,26 @@ bool gui_synclist_do_button(struct gui_synclist * lists,
735 to skip to root. ACTION_TREE_ROOT_INIT must be defined in the 735 to skip to root. ACTION_TREE_ROOT_INIT must be defined in the
736 keymaps as a repeated button press (the same as the repeated 736 keymaps as a repeated button press (the same as the repeated
737 ACTION_TREE_PGLEFT) with the pre condition being the non-repeated 737 ACTION_TREE_PGLEFT) with the pre condition being the non-repeated
738 button press */ 738 button press. Leave out ACTION_TREE_ROOT_INIT in your keymaps to
739 disable cancel action by PGLEFT key (e.g. if PGLEFT and CANCEL
740 are mapped to different keys) */
739 if (lists->offset_position[0] == 0) 741 if (lists->offset_position[0] == 0)
740 { 742 {
741 scrolling_left = false; 743 pgleft_allow_cancel = true;
742 *actionptr = ACTION_STD_CANCEL; 744 *actionptr = ACTION_STD_CANCEL;
743 return true; 745 return true;
744 } 746 }
745 *actionptr = ACTION_TREE_PGLEFT; 747 *actionptr = ACTION_TREE_PGLEFT;
746 case ACTION_TREE_PGLEFT: 748 case ACTION_TREE_PGLEFT:
747 if(!scrolling_left && (lists->offset_position[0] == 0)) 749 if(pgleft_allow_cancel && (lists->offset_position[0] == 0))
748 { 750 {
749 *actionptr = ACTION_STD_CANCEL; 751 *actionptr = ACTION_STD_CANCEL;
750 return false; 752 return false;
751 } 753 }
752 gui_synclist_scroll_left(lists); 754 gui_synclist_scroll_left(lists);
753 gui_synclist_draw(lists); 755 gui_synclist_draw(lists);
754 scrolling_left = true; /* stop ACTION_TREE_PAGE_LEFT 756 pgleft_allow_cancel = false; /* stop ACTION_TREE_PAGE_LEFT
755 skipping to root */ 757 skipping to root */
756 return true; 758 return true;
757#endif 759#endif
758/* for pgup / pgdown, we are obliged to have a different behaviour depending 760/* for pgup / pgdown, we are obliged to have a different behaviour depending