From 279e1426683b3854b65967d465526957888d53e7 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 20 Jul 2020 01:09:08 +0200 Subject: [PATCH] Properly hide other notification visibility screenshot settings when master one is disabled --- menu/menu_displaylist.c | 15 +++++++++++---- menu/menu_setting.c | 3 +++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index ac4ba31b54..55dc3498a2 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -7553,6 +7553,9 @@ unsigned menu_displaylist_build_list( #ifdef HAVE_GFX_WIDGETS bool widgets_supported = video_driver_has_widgets(); bool menu_enable_widgets = settings->bools.menu_enable_widgets; +#endif +#ifdef HAVE_SCREENSHOTS + bool notification_show_screenshot = settings->bools.notification_show_screenshot; #endif menu_displaylist_build_info_selective_t build_list[] = { {MENU_ENUM_LABEL_FPS_SHOW, PARSE_ONLY_BOOL, true }, @@ -7599,15 +7602,19 @@ unsigned menu_displaylist_build_list( break; case MENU_ENUM_LABEL_NOTIFICATION_SHOW_SCREENSHOT_DURATION: #ifdef HAVE_SCREENSHOTS - if (widgets_supported && - menu_enable_widgets) + if ( widgets_supported && + menu_enable_widgets && + notification_show_screenshot + ) build_list[i].checked = true; #endif break; case MENU_ENUM_LABEL_NOTIFICATION_SHOW_SCREENSHOT_FLASH: #ifdef HAVE_SCREENSHOTS - if (widgets_supported && - menu_enable_widgets) + if ( widgets_supported && + menu_enable_widgets && + notification_show_screenshot + ) build_list[i].checked = true; #endif break; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 2dcc9c493a..3e5beee88d 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -12720,6 +12720,9 @@ static bool setting_append_list( general_write_handler, 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_UINT( list, list_info,