(Menu) Selectively hide Video Layout

This commit is contained in:
twinaphex 2019-12-21 18:39:34 +01:00
parent 776ae626a6
commit 3224eefdf1
2 changed files with 25 additions and 4 deletions

View File

@ -6074,14 +6074,32 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
#ifdef HAVE_VIDEO_LAYOUT
case DISPLAYLIST_ONSCREEN_VIDEO_LAYOUT_SETTINGS_LIST:
{
menu_displaylist_build_info_t build_list[] = {
{MENU_ENUM_LABEL_VIDEO_LAYOUT_ENABLE, PARSE_ONLY_BOOL },
{MENU_ENUM_LABEL_VIDEO_LAYOUT_PATH, PARSE_ONLY_PATH },
{MENU_ENUM_LABEL_VIDEO_LAYOUT_SELECTED_VIEW, PARSE_ONLY_UINT },
settings_t *settings = config_get_ptr();
menu_displaylist_build_info_selective_t build_list[] = {
{MENU_ENUM_LABEL_VIDEO_LAYOUT_ENABLE, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_VIDEO_LAYOUT_PATH, PARSE_ONLY_PATH, false},
{MENU_ENUM_LABEL_VIDEO_LAYOUT_SELECTED_VIEW, PARSE_ONLY_UINT, false},
};
for (i = 0; i < ARRAY_SIZE(build_list); i++)
{
switch (build_list[i].enum_idx)
{
case MENU_ENUM_LABEL_VIDEO_LAYOUT_PATH:
case MENU_ENUM_LABEL_VIDEO_LAYOUT_SELECTED_VIEW:
if (settings->bools.video_layout_enable)
build_list[i].checked = true;
break;
default:
break;
}
}
for (i = 0; i < ARRAY_SIZE(build_list); i++)
{
if (!build_list[i].checked && !include_everything)
continue;
if (menu_displaylist_parse_settings_enum(list,
build_list[i].enum_idx, build_list[i].parse_type,
false) == 0)

View File

@ -12067,6 +12067,9 @@ static bool setting_append_list(
change_handler_video_layout_enable,
general_read_handler,
SD_FLAG_NONE);
(*list)[list_info->index - 1].action_ok = setting_bool_action_left_with_refresh;
(*list)[list_info->index - 1].action_left = setting_bool_action_left_with_refresh;
(*list)[list_info->index - 1].action_right = setting_bool_action_right_with_refresh;
CONFIG_PATH(
list, list_info,