mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 05:32:40 -05:00
Setttings: Eliminate gui_synclist_init_display_settings callbacks
Since synclists are now re-initialized after leaving Settings menus where the callback was used, it shouldn't be needed anymore. gui_synclist_init_display_settings can also be made local to list.c now. Change-Id: I674e4da49153440b48298fed7c4d98b421b7beaa
This commit is contained in:
parent
dfd9c10589
commit
ac9066dd44
4 changed files with 5 additions and 31 deletions
|
|
@ -123,7 +123,7 @@ void list_init_item_height(struct gui_synclist *list, enum screen_type screen)
|
|||
#endif
|
||||
}
|
||||
|
||||
void gui_synclist_init_display_settings(struct gui_synclist * list)
|
||||
static void gui_synclist_init_display_settings(struct gui_synclist * list)
|
||||
{
|
||||
struct user_settings *gs = &global_settings;
|
||||
list->scrollbar = gs->scrollbar;
|
||||
|
|
|
|||
|
|
@ -190,7 +190,6 @@ struct gui_synclist
|
|||
|
||||
extern void list_init(void);
|
||||
|
||||
extern void gui_synclist_init_display_settings(struct gui_synclist * list);
|
||||
extern void gui_synclist_init(
|
||||
struct gui_synclist * lists,
|
||||
list_get_name callback_get_item_name,
|
||||
|
|
|
|||
|
|
@ -335,22 +335,7 @@ MENUITEM_SETTING(list_accel_wait, &global_settings.list_accel_wait, NULL);
|
|||
MENUITEM_SETTING(offset_out_of_view, &global_settings.offset_out_of_view, NULL);
|
||||
MENUITEM_SETTING(screen_scroll_step, &global_settings.screen_scroll_step, NULL);
|
||||
MENUITEM_SETTING(scroll_paginated, &global_settings.scroll_paginated, NULL);
|
||||
|
||||
static int listwraparound_callback(int action,
|
||||
const struct menu_item_ex *this_item,
|
||||
struct gui_synclist *this_list)
|
||||
{
|
||||
(void)this_item;
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_EXIT_MENUITEM:
|
||||
gui_synclist_init_display_settings(this_list);
|
||||
break;
|
||||
}
|
||||
return action;
|
||||
}
|
||||
|
||||
MENUITEM_SETTING(list_wraparound, &global_settings.list_wraparound, listwraparound_callback);
|
||||
MENUITEM_SETTING(list_wraparound, &global_settings.list_wraparound, NULL);
|
||||
MENUITEM_SETTING(list_order, &global_settings.list_order, NULL);
|
||||
|
||||
MAKE_MENU(scroll_settings_menu, ID2P(LANG_SCROLL_MENU), 0, Icon_NOICON,
|
||||
|
|
|
|||
|
|
@ -165,16 +165,6 @@ MAKE_MENU(colors_settings, ID2P(LANG_COLORS_MENU),
|
|||
/* BARS MENU */
|
||||
/* */
|
||||
|
||||
static int list_update_callback(int action,
|
||||
const struct menu_item_ex *this_item,
|
||||
struct gui_synclist *this_list)
|
||||
{
|
||||
(void)this_item;
|
||||
if (action == ACTION_EXIT_MENUITEM)
|
||||
gui_synclist_init_display_settings(this_list);
|
||||
return ACTION_REDRAW;
|
||||
}
|
||||
|
||||
static int statusbar_callback_ex(int action,const struct menu_item_ex *this_item,
|
||||
enum screen_type screen)
|
||||
{
|
||||
|
|
@ -213,7 +203,7 @@ static int statusbar_callback(int action,
|
|||
return statusbar_callback_ex(action, this_item, SCREEN_MAIN);
|
||||
}
|
||||
|
||||
MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, list_update_callback);
|
||||
MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL);
|
||||
MENUITEM_SETTING(scrollbar_width, &global_settings.scrollbar_width, NULL);
|
||||
MENUITEM_SETTING(statusbar, &global_settings.statusbar, statusbar_callback);
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
|
|
@ -367,6 +357,7 @@ static int showicons_callback(int action,
|
|||
struct gui_synclist *this_list)
|
||||
{
|
||||
(void)this_item;
|
||||
(void)this_list;
|
||||
static bool old_icons;
|
||||
switch (action)
|
||||
{
|
||||
|
|
@ -376,7 +367,6 @@ static int showicons_callback(int action,
|
|||
case ACTION_EXIT_MENUITEM:
|
||||
if (old_icons != global_settings.show_icons)
|
||||
icons_init();
|
||||
gui_synclist_init_display_settings(this_list);
|
||||
break;
|
||||
}
|
||||
return ACTION_REDRAW;
|
||||
|
|
@ -386,7 +376,7 @@ MENUITEM_SETTING(show_icons, &global_settings.show_icons, showicons_callback);
|
|||
MENUITEM_FUNCTION(browse_themes, MENU_FUNC_USEPARAM,
|
||||
ID2P(LANG_CUSTOM_THEME),
|
||||
browse_folder, (void*)&themes, NULL, Icon_Config);
|
||||
MENUITEM_SETTING(cursor_style, &global_settings.cursor_style, list_update_callback);
|
||||
MENUITEM_SETTING(cursor_style, &global_settings.cursor_style, NULL);
|
||||
#if LCD_DEPTH > 1
|
||||
MENUITEM_SETTING(sep_menu, &global_settings.list_separator_height, NULL);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue