Allow menu wallpaper/background reset (#14650)

This commit is contained in:
sonninnos 2022-11-20 19:12:18 +02:00 committed by GitHub
parent 43b6d59740
commit e52b633e5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -469,6 +469,25 @@ static int action_start_state_slot(
return 0;
}
static int action_start_menu_wallpaper(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
{
settings_t *settings = config_get_ptr();
struct menu_state *menu_st = menu_state_get_ptr();
settings->paths.path_menu_wallpaper[0] = '\0';
/* Reset wallpaper by menu context reset */
if (menu_st->driver_ctx && menu_st->driver_ctx->context_reset)
{
menu_st->driver_ctx->context_reset(menu_st->userdata,
video_driver_is_threaded());
}
return 0;
}
static int action_start_playlist_sort_mode(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
@ -812,6 +831,9 @@ static int menu_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs)
case MENU_ENUM_LABEL_STATE_SLOT:
BIND_ACTION_START(cbs, action_start_state_slot);
break;
case MENU_ENUM_LABEL_MENU_WALLPAPER:
BIND_ACTION_START(cbs, action_start_menu_wallpaper);
break;
default:
return -1;
}