diff --git a/menu/menu_driver.c b/menu/menu_driver.c index b1d3d41cf4..17975e452a 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -336,3 +336,23 @@ bool menu_driver_load_background(void *data) return false; } + +void menu_driver_navigation_descend_alphabet(size_t *ptr_out) +{ + driver_t *driver = driver_get_ptr(); + if (!driver) + return; + + if (driver->menu_ctx && driver->menu_ctx->navigation_descend_alphabet) + driver->menu_ctx->navigation_descend_alphabet(ptr_out); +} + +void menu_driver_navigation_ascend_alphabet(size_t *ptr_out) +{ + driver_t *driver = driver_get_ptr(); + if (!driver) + return; + + if (driver->menu_ctx && driver->menu_ctx->navigation_ascend_alphabet) + driver->menu_ctx->navigation_ascend_alphabet(ptr_out); +} diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 5f403c3581..4a8887d69c 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -319,6 +319,10 @@ void menu_driver_populate_entries(const char *path, const char *label, bool menu_driver_load_background(void *data); +void menu_driver_navigation_descend_alphabet(size_t *); + +void menu_driver_navigation_ascend_alphabet(size_t *); + #ifdef __cplusplus } #endif diff --git a/menu/menu_navigation.c b/menu/menu_navigation.c index 09a48149d0..a283a13a21 100644 --- a/menu/menu_navigation.c +++ b/menu/menu_navigation.c @@ -157,8 +157,7 @@ void menu_navigation_descend_alphabet(menu_navigation_t *nav, size_t *ptr_out) i--; *ptr_out = nav->scroll.indices.list[i - 1]; - if (driver->menu_ctx && driver->menu_ctx->navigation_descend_alphabet) - driver->menu_ctx->navigation_descend_alphabet(ptr_out); + menu_driver_navigation_descend_alphabet(ptr_out); } /** @@ -189,6 +188,5 @@ void menu_navigation_ascend_alphabet(menu_navigation_t *nav, size_t *ptr_out) i++; *ptr_out = nav->scroll.indices.list[i + 1]; - if (driver->menu_ctx && driver->menu_ctx->navigation_descend_alphabet) - driver->menu_ctx->navigation_descend_alphabet(ptr_out); + menu_driver_navigation_ascend_alphabet(ptr_out); }