diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-09-19 11:52:30 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-05 11:22:34 -0400 |
commit | ff378deb69951a53b866f3d3c6ee13022e520436 (patch) | |
tree | 4e608fc9004d225b1121e3545642ab56186d0c0a /apps/gui | |
parent | ead172c05d57568d201709c5fac77cbb8982bbd0 (diff) | |
download | rockbox-ff378deb69951a53b866f3d3c6ee13022e520436.tar.gz rockbox-ff378deb69951a53b866f3d3c6ee13022e520436.zip |
gui: Remove gui_synclist_limit_scroll()
Since gui_synclist_do_button() overrides the setting at runtime
there is no reason to have a public API call to set it. Really
it should be a local variable, but it will be simpler to do that
after refactoring how list wraparound behavior is handled.
Change-Id: Id09d42197814102693752a9f64db8325118ca796
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/list.c | 20 | ||||
-rw-r--r-- | apps/gui/list.h | 1 | ||||
-rw-r--r-- | apps/gui/option_select.c | 1 |
3 files changed, 8 insertions, 14 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index 4779d5309a..713942af18 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -525,11 +525,6 @@ static void gui_synclist_select_previous_page(struct gui_synclist * lists, | |||
525 | gui_list_select_at_offset(lists, -nb_lines); | 525 | gui_list_select_at_offset(lists, -nb_lines); |
526 | } | 526 | } |
527 | 527 | ||
528 | void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll) | ||
529 | { | ||
530 | lists->limit_scroll = scroll; | ||
531 | } | ||
532 | |||
533 | /* | 528 | /* |
534 | * Makes all the item in the list scroll by one step to the right. | 529 | * Makes all the item in the list scroll by one step to the right. |
535 | * Should stop increasing the value when reaching the widest item value | 530 | * Should stop increasing the value when reaching the widest item value |
@@ -650,19 +645,20 @@ bool gui_synclist_do_button(struct gui_synclist * lists, | |||
650 | switch (wrap) | 645 | switch (wrap) |
651 | { | 646 | { |
652 | case LIST_WRAP_ON: | 647 | case LIST_WRAP_ON: |
653 | gui_synclist_limit_scroll(lists, !(lists->wraparound)); | 648 | lists->limit_scroll = !lists->wraparound; |
654 | break; | 649 | break; |
655 | case LIST_WRAP_OFF: | 650 | case LIST_WRAP_OFF: |
656 | gui_synclist_limit_scroll(lists, true); | 651 | lists->limit_scroll = true; |
657 | break; | 652 | break; |
658 | case LIST_WRAP_UNLESS_HELD: | 653 | case LIST_WRAP_UNLESS_HELD: |
659 | if (action == ACTION_STD_PREVREPEAT || | 654 | if (action == ACTION_STD_PREVREPEAT || |
660 | action == ACTION_STD_NEXTREPEAT || | 655 | action == ACTION_STD_NEXTREPEAT || |
661 | action == ACTION_LISTTREE_PGUP || | 656 | action == ACTION_LISTTREE_PGUP || |
662 | action == ACTION_LISTTREE_PGDOWN) | 657 | action == ACTION_LISTTREE_PGDOWN) |
663 | gui_synclist_limit_scroll(lists, true); | 658 | lists->limit_scroll = true; |
664 | else gui_synclist_limit_scroll(lists, !(lists->wraparound)); | 659 | else |
665 | break; | 660 | lists->limit_scroll = !lists->wraparound; |
661 | break; | ||
666 | }; | 662 | }; |
667 | 663 | ||
668 | switch (action) | 664 | switch (action) |
diff --git a/apps/gui/list.h b/apps/gui/list.h index e514f7252e..20410471a2 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -227,7 +227,6 @@ extern void gui_synclist_select_item(struct gui_synclist * lists, | |||
227 | int item_number); | 227 | int item_number); |
228 | extern void gui_synclist_add_item(struct gui_synclist * lists); | 228 | extern void gui_synclist_add_item(struct gui_synclist * lists); |
229 | extern void gui_synclist_del_item(struct gui_synclist * lists); | 229 | extern void gui_synclist_del_item(struct gui_synclist * lists); |
230 | extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll); | ||
231 | extern void gui_synclist_set_title(struct gui_synclist * lists, const char * title, | 230 | extern void gui_synclist_set_title(struct gui_synclist * lists, const char * title, |
232 | enum themable_icons icon); | 231 | enum themable_icons icon); |
233 | extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists, | 232 | extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists, |
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index 7068fee510..3f110ce526 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c | |||
@@ -506,7 +506,6 @@ bool option_screen(const struct settings_list *setting, | |||
506 | gui_synclist_set_nb_items(&lists, nb_items); | 506 | gui_synclist_set_nb_items(&lists, nb_items); |
507 | gui_synclist_select_item(&lists, selected); | 507 | gui_synclist_select_item(&lists, selected); |
508 | 508 | ||
509 | gui_synclist_limit_scroll(&lists, true); | ||
510 | gui_synclist_draw(&lists); | 509 | gui_synclist_draw(&lists); |
511 | /* talk the item */ | 510 | /* talk the item */ |
512 | gui_synclist_speak_item(&lists); | 511 | gui_synclist_speak_item(&lists); |