diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-09-19 11:38:09 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-05 10:22:55 -0400 |
commit | ead172c05d57568d201709c5fac77cbb8982bbd0 (patch) | |
tree | 10ab4de5bafb8092d1b1a3cd27ca8680cf650def /apps/menus | |
parent | fe6aa21e9eb88f49005863efd2003d0982920048 (diff) | |
download | rockbox-ead172c05d57568d201709c5fac77cbb8982bbd0.tar.gz rockbox-ead172c05d57568d201709c5fac77cbb8982bbd0.zip |
gui: Remove redundant copies of list scrolling settings
gui_list_screen_scroll_step() and gui_list_screen_scroll_out_of_view()
just copy the global setting into a local static variable.
Since they don't do anything special when the setting changes
it's simpler to use the global setting directly.
Change-Id: Ib6a7bf4e09b6dabbc1597cf28ddbafc0bc857526
Diffstat (limited to 'apps/menus')
-rw-r--r-- | apps/menus/display_menu.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c index 6ed0f34ab6..7823ba4082 100644 --- a/apps/menus/display_menu.c +++ b/apps/menus/display_menu.c | |||
@@ -332,22 +332,7 @@ MENUITEM_SETTING(list_accel_start_delay, | |||
332 | &global_settings.list_accel_start_delay, NULL); | 332 | &global_settings.list_accel_start_delay, NULL); |
333 | MENUITEM_SETTING(list_accel_wait, &global_settings.list_accel_wait, NULL); | 333 | MENUITEM_SETTING(list_accel_wait, &global_settings.list_accel_wait, NULL); |
334 | #endif /* HAVE_WHEEL_ACCELERATION */ | 334 | #endif /* HAVE_WHEEL_ACCELERATION */ |
335 | static int screenscroll_callback(int action, | 335 | MENUITEM_SETTING(offset_out_of_view, &global_settings.offset_out_of_view, NULL); |
336 | const struct menu_item_ex *this_item, | ||
337 | struct gui_synclist *this_list) | ||
338 | { | ||
339 | (void)this_item; | ||
340 | (void)this_list; | ||
341 | switch (action) | ||
342 | { | ||
343 | case ACTION_EXIT_MENUITEM: | ||
344 | gui_list_screen_scroll_out_of_view(global_settings.offset_out_of_view); | ||
345 | break; | ||
346 | } | ||
347 | return action; | ||
348 | } | ||
349 | MENUITEM_SETTING(offset_out_of_view, &global_settings.offset_out_of_view, | ||
350 | screenscroll_callback); | ||
351 | MENUITEM_SETTING(screen_scroll_step, &global_settings.screen_scroll_step, NULL); | 336 | MENUITEM_SETTING(screen_scroll_step, &global_settings.screen_scroll_step, NULL); |
352 | MENUITEM_SETTING(scroll_paginated, &global_settings.scroll_paginated, NULL); | 337 | MENUITEM_SETTING(scroll_paginated, &global_settings.scroll_paginated, NULL); |
353 | 338 | ||