diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/list.c | 22 | ||||
-rw-r--r-- | apps/gui/list.h | 4 |
2 files changed, 26 insertions, 0 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index c53a1f559c..d1b2748a60 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -576,6 +576,25 @@ static void gui_synclist_scroll_left(struct gui_synclist * lists) | |||
576 | } | 576 | } |
577 | #endif /* HAVE_LCD_BITMAP */ | 577 | #endif /* HAVE_LCD_BITMAP */ |
578 | 578 | ||
579 | #if CONFIG_CODEC == SWCODEC | ||
580 | bool gui_synclist_keyclick_callback(int action, void* data) | ||
581 | { | ||
582 | struct gui_synclist *lists = (struct gui_synclist *)data; | ||
583 | |||
584 | /* block the beep if we are at the end of the list and we are not wrapping. | ||
585 | * CAVEAT: mosts lists don't set limit_scroll untill it sees a repeat | ||
586 | * press at the end of the list so this can cause an extra beep. | ||
587 | */ | ||
588 | if (lists->limit_scroll == false) | ||
589 | return true; | ||
590 | if (lists->selected_item == 0) | ||
591 | return (action != ACTION_STD_PREV && action != ACTION_STD_PREVREPEAT); | ||
592 | if (lists->selected_item == lists->nb_items - lists->selected_size) | ||
593 | return (action != ACTION_STD_NEXT && action != ACTION_STD_NEXTREPEAT); | ||
594 | |||
595 | return action != ACTION_NONE; | ||
596 | } | ||
597 | #endif | ||
579 | 598 | ||
580 | bool gui_synclist_do_button(struct gui_synclist * lists, | 599 | bool gui_synclist_do_button(struct gui_synclist * lists, |
581 | int *actionptr, enum list_wrap wrap) | 600 | int *actionptr, enum list_wrap wrap) |
@@ -774,6 +793,9 @@ bool list_do_action(int context, int timeout, | |||
774 | do_button, and places the action from get_action in *action. */ | 793 | do_button, and places the action from get_action in *action. */ |
775 | { | 794 | { |
776 | timeout = list_do_action_timeout(lists, timeout); | 795 | timeout = list_do_action_timeout(lists, timeout); |
796 | #if CONFIG_CODEC == SWCODEC | ||
797 | keyclick_set_callback(gui_synclist_keyclick_callback, lists); | ||
798 | #endif | ||
777 | *action = get_action(context, timeout); | 799 | *action = get_action(context, timeout); |
778 | return gui_synclist_do_button(lists, action, wrap); | 800 | return gui_synclist_do_button(lists, action, wrap); |
779 | } | 801 | } |
diff --git a/apps/gui/list.h b/apps/gui/list.h index c53604659e..d9df008956 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -165,6 +165,10 @@ extern void gui_synclist_set_title(struct gui_synclist * lists, char * title, | |||
165 | enum themable_icons icon); | 165 | enum themable_icons icon); |
166 | extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists, | 166 | extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists, |
167 | bool hide); | 167 | bool hide); |
168 | |||
169 | #if CONFIG_CODEC == SWCODEC | ||
170 | extern bool gui_synclist_keyclick_callback(int action, void* data); | ||
171 | #endif | ||
168 | /* | 172 | /* |
169 | * Do the action implied by the given button, | 173 | * Do the action implied by the given button, |
170 | * returns true if the action was handled. | 174 | * returns true if the action was handled. |