summaryrefslogtreecommitdiff
path: root/apps/gui/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r--apps/gui/list.c15
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
723unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button) 723unsigned 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