diff options
author | Martin Scarratt <mmmm@rockbox.org> | 2006-09-25 10:56:38 +0000 |
---|---|---|
committer | Martin Scarratt <mmmm@rockbox.org> | 2006-09-25 10:56:38 +0000 |
commit | 1ab1f02dfecc8f0b35cf5668398ea327b25828b7 (patch) | |
tree | 16f9b74118d806822e005504088ceff23d1735b6 /apps/gui/list.c | |
parent | ec2a5cce1a4e3609535a9ae902a80933fbb0f341 (diff) | |
download | rockbox-1ab1f02dfecc8f0b35cf5668398ea327b25828b7.tar.gz rockbox-1ab1f02dfecc8f0b35cf5668398ea327b25828b7.zip |
fix the bug where when scrolling text left in the filebrowser you could suddenly find yourself in the root directory. A long press on the left scrolling button will still take you to the root quickly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11042 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r-- | apps/gui/list.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index 164bfc8773..7ca5e91b99 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -722,6 +722,8 @@ void gui_synclist_scroll_left(struct gui_synclist * lists) | |||
722 | 722 | ||
723 | unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button) | 723 | unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button) |
724 | { | 724 | { |
725 | static bool scrolling_left = false; | ||
726 | |||
725 | gui_synclist_limit_scroll(lists, true); | 727 | gui_synclist_limit_scroll(lists, true); |
726 | switch(button) | 728 | switch(button) |
727 | { | 729 | { |
@@ -744,15 +746,26 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button) | |||
744 | return ACTION_STD_NEXT; | 746 | return ACTION_STD_NEXT; |
745 | 747 | ||
746 | #ifdef HAVE_LCD_BITMAP | 748 | #ifdef HAVE_LCD_BITMAP |
749 | case ACTION_TREE_ROOT_INIT: | ||
750 | /* After this button press ACTION_TREE_PGLEFT is allowed to skip to root. | ||
751 | ACTION_TREE_ROOT_INIT must be defined in the keymaps as a repeated | ||
752 | button press (the same as the repeated ACTION_TREE_PGLEFT) with the | ||
753 | pre condition being the non-repeated button press */ | ||
754 | if (lists->gui_list[0].offset_position == 0) | ||
755 | { | ||
756 | scrolling_left = false; | ||
757 | return ACTION_STD_CANCEL; | ||
758 | } | ||
747 | case ACTION_TREE_PGRIGHT: | 759 | case ACTION_TREE_PGRIGHT: |
748 | gui_synclist_scroll_right(lists); | 760 | gui_synclist_scroll_right(lists); |
749 | gui_synclist_draw(lists); | 761 | gui_synclist_draw(lists); |
750 | return ACTION_TREE_PGRIGHT; | 762 | return ACTION_TREE_PGRIGHT; |
751 | case ACTION_TREE_PGLEFT: | 763 | case ACTION_TREE_PGLEFT: |
752 | if (lists->gui_list[0].offset_position == 0) | 764 | if(!scrolling_left && (lists->gui_list[0].offset_position == 0)) |
753 | return ACTION_STD_CANCEL; | 765 | return ACTION_STD_CANCEL; |
754 | gui_synclist_scroll_left(lists); | 766 | gui_synclist_scroll_left(lists); |
755 | gui_synclist_draw(lists); | 767 | gui_synclist_draw(lists); |
768 | scrolling_left = true; /* stop ACTION_TREE_PAGE_LEFT skipping to root */ | ||
756 | return ACTION_TREE_PGLEFT; | 769 | return ACTION_TREE_PGLEFT; |
757 | #endif | 770 | #endif |
758 | 771 | ||