summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-09-20 13:27:51 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-10-05 11:23:11 -0400
commite57b4f909901ccc04b596ea817a98100b5f7b33b (patch)
tree1f391a6f2a9621be282234c5d053de6fa264e6bd
parent1c5a0497cf7735009b26dd0da82ea2820a2486a2 (diff)
downloadrockbox-e57b4f909901ccc04b596ea817a98100b5f7b33b.tar.gz
rockbox-e57b4f909901ccc04b596ea817a98100b5f7b33b.zip
gui: Remove gui_synclist_item_is_onscreen()
Only the "Rockbox Info" screen uses it for a rather silly purpose, so remove the function. This helps to decouple things from the GUI. Change-Id: Icf73e3ee1230c75bf43016c0f1c05c7fe1a24895
-rw-r--r--apps/gui/list.c7
-rw-r--r--apps/gui/list.h2
-rw-r--r--apps/menus/main_menu.c3
3 files changed, 1 insertions, 11 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c
index bb5d1a922e..d15948e97a 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -800,13 +800,6 @@ bool list_do_action(int context, int timeout,
return gui_synclist_do_button(lists, action);
}
-bool gui_synclist_item_is_onscreen(struct gui_synclist *lists,
- enum screen_type screen, int item)
-{
- int nb_lines = list_get_nb_lines(lists, screen);
- return (unsigned)(item - lists->start_item[screen]) < (unsigned) nb_lines;
-}
-
/* Simple use list implementation */
static int simplelist_line_count = 0, simplelist_line_remaining;
static int simplelist_line_pos;
diff --git a/apps/gui/list.h b/apps/gui/list.h
index b716d8afd9..ede62d7b0a 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -220,8 +220,6 @@ extern void gui_synclist_add_item(struct gui_synclist * lists);
extern void gui_synclist_del_item(struct gui_synclist * lists);
extern void gui_synclist_set_title(struct gui_synclist * lists, const char * title,
enum themable_icons icon);
-extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists,
- enum screen_type screen, int item);
extern bool gui_synclist_keyclick_callback(int action, void* data);
/*
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 2814c44fe6..03873faac9 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -441,8 +441,7 @@ static int info_action_callback(int action, struct gui_synclist *lists)
else if (action == ACTION_NONE)
{
static int last_redraw = 0;
- if (gui_synclist_item_is_onscreen(lists, 0, INFO_TIME)
- && TIME_AFTER(current_tick, last_redraw + HZ*5))
+ if (TIME_AFTER(current_tick, last_redraw + HZ*5))
{
last_redraw = current_tick;
return ACTION_REDRAW;