diff --git a/config.def.h b/config.def.h index 764d8ab21c..aea4a06e02 100644 --- a/config.def.h +++ b/config.def.h @@ -94,6 +94,8 @@ #ifdef HAVE_MATERIALUI /* Show icons to the left of each menu entry */ #define DEFAULT_MATERIALUI_ICONS_ENABLE true +/* Show boolean option ON/OFF icons */ +#define DEFAULT_MATERIALUI_SWITCH_ICONS true /* Show system-specific icons in the playlists tab */ #define DEFAULT_MATERIALUI_PLAYLIST_ICONS_ENABLE true #endif @@ -732,10 +734,11 @@ #define DEFAULT_XMB_ANIMATION 0 #define DEFAULT_XMB_VERTICAL_FADE_FACTOR 100 #define DEFAULT_XMB_SHOW_TITLE_HEADER true +#define DEFAULT_XMB_SWITCH_ICONS true #define DEFAULT_XMB_TITLE_MARGIN 5 #define DEFAULT_XMB_TITLE_MARGIN_HORIZONTAL_OFFSET 0 #define MAXIMUM_XMB_TITLE_MARGIN 12 -#define DEFAULT_XMB_ALPHA_FACTOR 75 +#define DEFAULT_XMB_ALPHA_FACTOR 75 #define DEFAULT_MENU_FONT_COLOR_RED 255 #define DEFAULT_MENU_FONT_COLOR_GREEN 255 diff --git a/configuration.c b/configuration.c index d9ab8370c4..f70c5f3ea0 100644 --- a/configuration.c +++ b/configuration.c @@ -1609,13 +1609,13 @@ static struct config_bool_setting *populate_settings_bool( struct config_bool_setting *tmp = (struct config_bool_setting*)calloc(1, (*size + 1) * sizeof(struct config_bool_setting)); unsigned count = 0; - SETTING_BOOL("accessibility_enable", &settings->bools.accessibility_enable, true, DEFAULT_ACCESSIBILITY_ENABLE, false); - SETTING_BOOL("driver_switch_enable", &settings->bools.driver_switch_enable, true, DEFAULT_DRIVER_SWITCH_ENABLE, false); + SETTING_BOOL("accessibility_enable", &settings->bools.accessibility_enable, true, DEFAULT_ACCESSIBILITY_ENABLE, false); + SETTING_BOOL("driver_switch_enable", &settings->bools.driver_switch_enable, true, DEFAULT_DRIVER_SWITCH_ENABLE, false); SETTING_BOOL("frame_time_counter_reset_after_fastforwarding", &settings->bools.frame_time_counter_reset_after_fastforwarding, true, false, false); SETTING_BOOL("frame_time_counter_reset_after_load_state", &settings->bools.frame_time_counter_reset_after_load_state, true, false, false); SETTING_BOOL("frame_time_counter_reset_after_save_state", &settings->bools.frame_time_counter_reset_after_save_state, true, false, false); SETTING_BOOL("crt_switch_resolution_use_custom_refresh_rate", &settings->bools.crt_switch_custom_refresh_enable, true, false, false); - SETTING_BOOL("crt_switch_hires_menu", &settings->bools.crt_switch_hires_menu, true, false, true); + SETTING_BOOL("crt_switch_hires_menu", &settings->bools.crt_switch_hires_menu, true, false, true); SETTING_BOOL("ui_companion_start_on_boot", &settings->bools.ui_companion_start_on_boot, true, DEFAULT_UI_COMPANION_START_ON_BOOT, false); SETTING_BOOL("ui_companion_enable", &settings->bools.ui_companion_enable, true, DEFAULT_UI_COMPANION_ENABLE, false); SETTING_BOOL("ui_companion_toggle", &settings->bools.ui_companion_toggle, false, DEFAULT_UI_COMPANION_TOGGLE, false); @@ -1688,7 +1688,7 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("video_shader_enable", &settings->bools.video_shader_enable, true, DEFAULT_SHADER_ENABLE, false); SETTING_BOOL("video_shader_watch_files", &settings->bools.video_shader_watch_files, true, DEFAULT_VIDEO_SHADER_WATCH_FILES, false); SETTING_BOOL("video_shader_remember_last_dir", &settings->bools.video_shader_remember_last_dir, true, DEFAULT_VIDEO_SHADER_REMEMBER_LAST_DIR, false); - SETTING_BOOL("video_shader_preset_save_reference_enable", &settings->bools.video_shader_preset_save_reference_enable, true, DEFAULT_VIDEO_SHADER_PRESET_SAVE_REFERENCE_ENABLE, false); + SETTING_BOOL("video_shader_preset_save_reference_enable", &settings->bools.video_shader_preset_save_reference_enable, true, DEFAULT_VIDEO_SHADER_PRESET_SAVE_REFERENCE_ENABLE, false); /* Let implementation decide if automatic, or 1:1 PAR. */ SETTING_BOOL("video_aspect_ratio_auto", &settings->bools.video_aspect_ratio_auto, true, DEFAULT_ASPECT_RATIO_AUTO, false); @@ -1728,15 +1728,15 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("audio_enable", &settings->bools.audio_enable, true, DEFAULT_AUDIO_ENABLE, false); SETTING_BOOL("menu_enable_widgets", &settings->bools.menu_enable_widgets, true, DEFAULT_MENU_ENABLE_WIDGETS, false); SETTING_BOOL("menu_show_load_content_animation", &settings->bools.menu_show_load_content_animation, true, DEFAULT_MENU_SHOW_LOAD_CONTENT_ANIMATION, false); - SETTING_BOOL("notification_show_autoconfig", &settings->bools.notification_show_autoconfig, true, DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG, false); + SETTING_BOOL("notification_show_autoconfig", &settings->bools.notification_show_autoconfig, true, DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG, false); SETTING_BOOL("notification_show_cheats_applied", &settings->bools.notification_show_cheats_applied, true, DEFAULT_NOTIFICATION_SHOW_CHEATS_APPLIED, false); SETTING_BOOL("notification_show_patch_applied", &settings->bools.notification_show_patch_applied, true, DEFAULT_NOTIFICATION_SHOW_PATCH_APPLIED, false); - SETTING_BOOL("notification_show_remap_load", &settings->bools.notification_show_remap_load, true, DEFAULT_NOTIFICATION_SHOW_REMAP_LOAD, false); + SETTING_BOOL("notification_show_remap_load", &settings->bools.notification_show_remap_load, true, DEFAULT_NOTIFICATION_SHOW_REMAP_LOAD, false); SETTING_BOOL("notification_show_config_override_load", &settings->bools.notification_show_config_override_load, true, DEFAULT_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD, false); SETTING_BOOL("notification_show_set_initial_disk", &settings->bools.notification_show_set_initial_disk, true, DEFAULT_NOTIFICATION_SHOW_SET_INITIAL_DISK, false); SETTING_BOOL("notification_show_fast_forward", &settings->bools.notification_show_fast_forward, true, DEFAULT_NOTIFICATION_SHOW_FAST_FORWARD, false); #ifdef HAVE_SCREENSHOTS - SETTING_BOOL("notification_show_screenshot", &settings->bools.notification_show_screenshot, true, DEFAULT_NOTIFICATION_SHOW_SCREENSHOT, false); + SETTING_BOOL("notification_show_screenshot", &settings->bools.notification_show_screenshot, true, DEFAULT_NOTIFICATION_SHOW_SCREENSHOT, false); #endif SETTING_BOOL("notification_show_refresh_rate", &settings->bools.notification_show_refresh_rate, true, DEFAULT_NOTIFICATION_SHOW_REFRESH_RATE, false); #ifdef HAVE_NETWORKING @@ -1787,22 +1787,17 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("menu_linear_filter", &settings->bools.menu_linear_filter, true, DEFAULT_VIDEO_SMOOTH, false); SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, DEFAULT_MENU_HORIZONTAL_ANIMATION, false); SETTING_BOOL("menu_pause_libretro", &settings->bools.menu_pause_libretro, true, true, false); - SETTING_BOOL("menu_savestate_resume", -&settings->bools.menu_savestate_resume, true, DEFAULT_MENU_SAVESTATE_RESUME, false); + SETTING_BOOL("menu_savestate_resume", &settings->bools.menu_savestate_resume, true, DEFAULT_MENU_SAVESTATE_RESUME, false); SETTING_BOOL("menu_insert_disk_resume", &settings->bools.menu_insert_disk_resume, true, DEFAULT_MENU_INSERT_DISK_RESUME, false); SETTING_BOOL("menu_mouse_enable", &settings->bools.menu_mouse_enable, true, DEFAULT_MOUSE_ENABLE, false); SETTING_BOOL("menu_pointer_enable", &settings->bools.menu_pointer_enable, true, DEFAULT_POINTER_ENABLE, false); SETTING_BOOL("menu_timedate_enable", &settings->bools.menu_timedate_enable, true, DEFAULT_MENU_TIMEDATE_ENABLE, false); SETTING_BOOL("menu_battery_level_enable", &settings->bools.menu_battery_level_enable, true, true, false); SETTING_BOOL("menu_core_enable", &settings->bools.menu_core_enable, true, true, false); - SETTING_BOOL("menu_show_sublabels", -&settings->bools.menu_show_sublabels, true, DEFAULT_MENU_SHOW_SUBLABELS, false); - SETTING_BOOL("menu_dynamic_wallpaper_enable", - &settings->bools.menu_dynamic_wallpaper_enable, true, - DEFAULT_MENU_DYNAMIC_WALLPAPER_ENABLE, false); + SETTING_BOOL("menu_show_sublabels", &settings->bools.menu_show_sublabels, true, DEFAULT_MENU_SHOW_SUBLABELS, false); + SETTING_BOOL("menu_dynamic_wallpaper_enable", &settings->bools.menu_dynamic_wallpaper_enable, true, DEFAULT_MENU_DYNAMIC_WALLPAPER_ENABLE, false); SETTING_BOOL("menu_ticker_smooth", &settings->bools.menu_ticker_smooth, true, DEFAULT_MENU_TICKER_SMOOTH, false); - SETTING_BOOL("menu_scroll_fast", -&settings->bools.menu_scroll_fast, true, DEFAULT_MENU_SCROLL_FAST, false); + SETTING_BOOL("menu_scroll_fast", &settings->bools.menu_scroll_fast, true, DEFAULT_MENU_SCROLL_FAST, false); SETTING_BOOL("settings_show_drivers", &settings->bools.settings_show_drivers, true, DEFAULT_SETTINGS_SHOW_DRIVERS, false); SETTING_BOOL("settings_show_video", &settings->bools.settings_show_video, true, DEFAULT_SETTINGS_SHOW_VIDEO, false); @@ -1910,9 +1905,10 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("menu_navigation_wraparound_enable", &settings->bools.menu_navigation_wraparound_enable, true, true, false); SETTING_BOOL("menu_navigation_browser_filter_supported_extensions_enable", &settings->bools.menu_navigation_browser_filter_supported_extensions_enable, true, true, false); - SETTING_BOOL("menu_show_advanced_settings", &settings->bools.menu_show_advanced_settings, true, DEFAULT_SHOW_ADVANCED_SETTINGS, false); + SETTING_BOOL("menu_show_advanced_settings", &settings->bools.menu_show_advanced_settings, true, DEFAULT_SHOW_ADVANCED_SETTINGS, false); #ifdef HAVE_MATERIALUI - SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, DEFAULT_MATERIALUI_ICONS_ENABLE, false); + SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, DEFAULT_MATERIALUI_ICONS_ENABLE, false); + SETTING_BOOL("materialui_switch_icons", &settings->bools.menu_materialui_switch_icons, true, DEFAULT_MATERIALUI_SWITCH_ICONS, false); SETTING_BOOL("materialui_playlist_icons_enable", &settings->bools.menu_materialui_playlist_icons_enable, true, DEFAULT_MATERIALUI_PLAYLIST_ICONS_ENABLE, false); SETTING_BOOL("materialui_show_nav_bar", &settings->bools.menu_materialui_show_nav_bar, true, DEFAULT_MATERIALUI_SHOW_NAV_BAR, false); SETTING_BOOL("materialui_auto_rotate_nav_bar", &settings->bools.menu_materialui_auto_rotate_nav_bar, true, DEFAULT_MATERIALUI_AUTO_ROTATE_NAV_BAR, false); @@ -1926,19 +1922,17 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("menu_rgui_transparency", &settings->bools.menu_rgui_transparency, true, DEFAULT_RGUI_TRANSPARENCY, false); SETTING_BOOL("menu_rgui_shadows", &settings->bools.menu_rgui_shadows, true, DEFAULT_RGUI_SHADOWS, false); SETTING_BOOL("menu_rgui_full_width_layout", &settings->bools.menu_rgui_full_width_layout, true, DEFAULT_RGUI_FULL_WIDTH_LAYOUT, false); - SETTING_BOOL("rgui_inline_thumbnails", - &settings->bools.menu_rgui_inline_thumbnails, true, - DEFAULT_RGUI_INLINE_THUMBNAILS, false); - SETTING_BOOL("rgui_swap_thumbnails", - &settings->bools.menu_rgui_swap_thumbnails, true, DEFAULT_RGUI_SWAP_THUMBNAILS, false); + SETTING_BOOL("rgui_inline_thumbnails", &settings->bools.menu_rgui_inline_thumbnails, true, DEFAULT_RGUI_INLINE_THUMBNAILS, false); + SETTING_BOOL("rgui_swap_thumbnails", &settings->bools.menu_rgui_swap_thumbnails, true, DEFAULT_RGUI_SWAP_THUMBNAILS, false); SETTING_BOOL("rgui_extended_ascii", &settings->bools.menu_rgui_extended_ascii, true, DEFAULT_RGUI_EXTENDED_ASCII, false); SETTING_BOOL("rgui_switch_icons", &settings->bools.menu_rgui_switch_icons, true, DEFAULT_RGUI_SWITCH_ICONS, false); SETTING_BOOL("rgui_particle_effect_screensaver", &settings->bools.menu_rgui_particle_effect_screensaver, true, DEFAULT_RGUI_PARTICLE_EFFECT_SCREENSAVER, false); #endif #ifdef HAVE_XMB - SETTING_BOOL("xmb_shadows_enable", &settings->bools.menu_xmb_shadows_enable, true, DEFAULT_XMB_SHADOWS_ENABLE, false); - SETTING_BOOL("xmb_vertical_thumbnails", &settings->bools.menu_xmb_vertical_thumbnails, true, DEFAULT_XMB_VERTICAL_THUMBNAILS, false); - SETTING_BOOL("menu_xmb_show_title_header", &settings->bools.menu_xmb_show_title_header, true, DEFAULT_XMB_SHOW_TITLE_HEADER, false); + SETTING_BOOL("xmb_shadows_enable", &settings->bools.menu_xmb_shadows_enable, true, DEFAULT_XMB_SHADOWS_ENABLE, false); + SETTING_BOOL("xmb_switch_icons", &settings->bools.menu_xmb_switch_icons, true, DEFAULT_XMB_SWITCH_ICONS, false); + SETTING_BOOL("xmb_vertical_thumbnails", &settings->bools.menu_xmb_vertical_thumbnails, true, DEFAULT_XMB_VERTICAL_THUMBNAILS, false); + SETTING_BOOL("menu_xmb_show_title_header", &settings->bools.menu_xmb_show_title_header, true, DEFAULT_XMB_SHOW_TITLE_HEADER, false); #endif #endif #ifdef HAVE_CHEEVOS @@ -1959,9 +1953,9 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("input_overlay_behind_menu", &settings->bools.input_overlay_behind_menu, true, DEFAULT_OVERLAY_BEHIND_MENU, false); SETTING_BOOL("input_overlay_hide_in_menu", &settings->bools.input_overlay_hide_in_menu, true, DEFAULT_OVERLAY_HIDE_IN_MENU, false); SETTING_BOOL("input_overlay_hide_when_gamepad_connected", &settings->bools.input_overlay_hide_when_gamepad_connected, true, DEFAULT_OVERLAY_HIDE_WHEN_GAMEPAD_CONNECTED, false); - SETTING_BOOL("input_overlay_show_mouse_cursor", &settings->bools.input_overlay_show_mouse_cursor, true, DEFAULT_OVERLAY_SHOW_MOUSE_CURSOR, false); - SETTING_BOOL("input_overlay_auto_rotate", &settings->bools.input_overlay_auto_rotate, true, DEFAULT_OVERLAY_AUTO_ROTATE, false); - SETTING_BOOL("input_overlay_auto_scale", &settings->bools.input_overlay_auto_scale, true, DEFAULT_INPUT_OVERLAY_AUTO_SCALE, false); + SETTING_BOOL("input_overlay_show_mouse_cursor", &settings->bools.input_overlay_show_mouse_cursor, true, DEFAULT_OVERLAY_SHOW_MOUSE_CURSOR, false); + SETTING_BOOL("input_overlay_auto_rotate", &settings->bools.input_overlay_auto_rotate, true, DEFAULT_OVERLAY_AUTO_ROTATE, false); + SETTING_BOOL("input_overlay_auto_scale", &settings->bools.input_overlay_auto_scale, true, DEFAULT_INPUT_OVERLAY_AUTO_SCALE, false); #endif #ifdef HAVE_VIDEO_LAYOUT SETTING_BOOL("video_layout_enable", &settings->bools.video_layout_enable, true, true, false); @@ -1990,7 +1984,7 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("auto_remaps_enable", &settings->bools.auto_remaps_enable, true, DEFAULT_AUTO_REMAPS_ENABLE, false); SETTING_BOOL("global_core_options", &settings->bools.global_core_options, true, DEFAULT_GLOBAL_CORE_OPTIONS, false); SETTING_BOOL("auto_shaders_enable", &settings->bools.auto_shaders_enable, true, DEFAULT_AUTO_SHADERS_ENABLE, false); - SETTING_BOOL("scan_without_core_match", &settings->bools.scan_without_core_match, true, DEFAULT_SCAN_WITHOUT_CORE_MATCH, false); + SETTING_BOOL("scan_without_core_match", &settings->bools.scan_without_core_match, true, DEFAULT_SCAN_WITHOUT_CORE_MATCH, false); SETTING_BOOL("sort_savefiles_enable", &settings->bools.sort_savefiles_enable, true, DEFAULT_SORT_SAVEFILES_ENABLE, false); SETTING_BOOL("sort_savestates_enable", &settings->bools.sort_savestates_enable, true, DEFAULT_SORT_SAVESTATES_ENABLE, false); SETTING_BOOL("sort_savefiles_by_content_enable", &settings->bools.sort_savefiles_by_content_enable, true, DEFAULT_SORT_SAVEFILES_BY_CONTENT_ENABLE, false); @@ -2013,14 +2007,13 @@ static struct config_bool_setting *populate_settings_bool( #endif SETTING_BOOL("savestates_in_content_dir", &settings->bools.savestates_in_content_dir, true, DEFAULT_SAVESTATES_IN_CONTENT_DIR, false); - SETTING_BOOL("savefiles_in_content_dir", &settings->bools.savefiles_in_content_dir, true, DEFAULT_SAVEFILES_IN_CONTENT_DIR, false); + SETTING_BOOL("savefiles_in_content_dir", &settings->bools.savefiles_in_content_dir, true, DEFAULT_SAVEFILES_IN_CONTENT_DIR, false); SETTING_BOOL("systemfiles_in_content_dir", &settings->bools.systemfiles_in_content_dir, true, DEFAULT_SYSTEMFILES_IN_CONTENT_DIR, false); SETTING_BOOL("screenshots_in_content_dir", &settings->bools.screenshots_in_content_dir, true, DEFAULT_SCREENSHOTS_IN_CONTENT_DIR, false); - SETTING_BOOL("video_msg_bgcolor_enable", -&settings->bools.video_msg_bgcolor_enable, true, DEFAULT_MESSAGE_BGCOLOR_ENABLE, false); + SETTING_BOOL("video_msg_bgcolor_enable", &settings->bools.video_msg_bgcolor_enable, true, DEFAULT_MESSAGE_BGCOLOR_ENABLE, false); SETTING_BOOL("video_window_show_decorations", &settings->bools.video_window_show_decorations, true, DEFAULT_WINDOW_DECORATIONS, false); - SETTING_BOOL("video_window_save_positions", &settings->bools.video_window_save_positions, true, DEFAULT_WINDOW_SAVE_POSITIONS, false); + SETTING_BOOL("video_window_save_positions", &settings->bools.video_window_save_positions, true, DEFAULT_WINDOW_SAVE_POSITIONS, false); SETTING_BOOL("video_window_custom_size_enable", &settings->bools.video_window_custom_size_enable, true, DEFAULT_WINDOW_CUSTOM_SIZE_ENABLE, false); SETTING_BOOL("sustained_performance_mode", &settings->bools.sustained_performance_mode, true, DEFAULT_SUSTAINED_PERFORMANCE_MODE, false); @@ -2045,14 +2038,13 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("playlist_fuzzy_archive_match", &settings->bools.playlist_fuzzy_archive_match, true, DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH, false); SETTING_BOOL("playlist_portable_paths", &settings->bools.playlist_portable_paths, true, DEFAULT_PLAYLIST_PORTABLE_PATHS, false); - SETTING_BOOL("quit_press_twice", &settings->bools.quit_press_twice, true, DEFAULT_QUIT_PRESS_TWICE, false); - SETTING_BOOL("vibrate_on_keypress", &settings->bools.vibrate_on_keypress, -true, DEFAULT_VIBRATE_ON_KEYPRESS, false); - SETTING_BOOL("enable_device_vibration", &settings->bools.enable_device_vibration, true, DEFAULT_ENABLE_DEVICE_VIBRATION, false); + SETTING_BOOL("quit_press_twice", &settings->bools.quit_press_twice, true, DEFAULT_QUIT_PRESS_TWICE, false); + SETTING_BOOL("vibrate_on_keypress", &settings->bools.vibrate_on_keypress, true, DEFAULT_VIBRATE_ON_KEYPRESS, false); + SETTING_BOOL("enable_device_vibration", &settings->bools.enable_device_vibration, true, DEFAULT_ENABLE_DEVICE_VIBRATION, false); #ifdef HAVE_OZONE - SETTING_BOOL("ozone_collapse_sidebar", &settings->bools.ozone_collapse_sidebar, true, DEFAULT_OZONE_COLLAPSE_SIDEBAR, false); - SETTING_BOOL("ozone_scroll_content_metadata",&settings->bools.ozone_scroll_content_metadata, true, DEFAULT_OZONE_SCROLL_CONTENT_METADATA, false); + SETTING_BOOL("ozone_collapse_sidebar", &settings->bools.ozone_collapse_sidebar, true, DEFAULT_OZONE_COLLAPSE_SIDEBAR, false); + SETTING_BOOL("ozone_scroll_content_metadata", &settings->bools.ozone_scroll_content_metadata, true, DEFAULT_OZONE_SCROLL_CONTENT_METADATA, false); #endif #if defined(HAVE_OZONE) || defined(HAVE_XMB) SETTING_BOOL("ozone_truncate_playlist_name", &settings->bools.ozone_truncate_playlist_name, true, DEFAULT_OZONE_TRUNCATE_PLAYLIST_NAME, false); diff --git a/configuration.h b/configuration.h index e8fe1ccf9d..c45a831b89 100644 --- a/configuration.h +++ b/configuration.h @@ -695,6 +695,7 @@ typedef struct settings #endif bool menu_materialui_icons_enable; bool menu_materialui_playlist_icons_enable; + bool menu_materialui_switch_icons; bool menu_materialui_show_nav_bar; bool menu_materialui_auto_rotate_nav_bar; bool menu_materialui_dual_thumbnail_list_view_enable; @@ -711,8 +712,9 @@ typedef struct settings bool menu_rgui_switch_icons; bool menu_rgui_particle_effect_screensaver; bool menu_xmb_shadows_enable; - bool menu_xmb_vertical_thumbnails; bool menu_xmb_show_title_header; + bool menu_xmb_switch_icons; + bool menu_xmb_vertical_thumbnails; bool menu_content_show_settings; bool menu_content_show_favorites; bool menu_content_show_images; diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 351e0a2cee..466f2b5759 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -4358,6 +4358,10 @@ MSG_HASH( MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE, "materialui_icons_enable" ) +MSG_HASH( + MENU_ENUM_LABEL_MATERIALUI_SWITCH_ICONS, + "materialui_switch_icons" + ) MSG_HASH( MENU_ENUM_LABEL_MATERIALUI_PLAYLIST_ICONS_ENABLE, "materialui_playlist_icons_enable" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index bf0f4bb4c4..c5bee59640 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -9715,7 +9715,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_MENU_RGUI_SWITCH_ICONS, - "Show Switch Icons" + "Switch Icons" ) MSG_HASH( MENU_ENUM_SUBLABEL_MENU_RGUI_SWITCH_ICONS, @@ -10091,6 +10091,14 @@ MSG_HASH( MENU_ENUM_SUBLABEL_XMB_THEME, "Select a different icon theme for RetroArch." ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_XMB_SWITCH_ICONS, + "Switch Icons" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_XMB_SWITCH_ICONS, + "Use icons instead of ON/OFF text to represent 'toggle switch' menu settings entries." + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_XMB_SHADOWS_ENABLE, "Draw Shadows" @@ -10436,6 +10444,14 @@ MSG_HASH( MENU_ENUM_SUBLABEL_MATERIALUI_ICONS_ENABLE, "Show icons to the left of the menu entries." ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_MATERIALUI_SWITCH_ICONS, + "Switch Icons" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_MATERIALUI_SWITCH_ICONS, + "Use icons instead of ON/OFF text to represent 'toggle switch' menu settings entries." + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_MATERIALUI_PLAYLIST_ICONS_ENABLE, "Playlist Icons (Restart Required)" diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index e05785a5f7..548bd0a956 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -4018,10 +4018,10 @@ int action_ok_core_option_dropdown_list(const char *path, if ( string_is_empty(value_label_0) || string_is_empty(value_label_1) - || !((string_is_equal(value_label_0, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON)) - && string_is_equal(value_label_1, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))) - || (string_is_equal(value_label_0, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)) - && string_is_equal(value_label_1, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))))) + || !( ( string_is_equal(value_label_0, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON)) + && string_is_equal(value_label_1, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))) + || ( string_is_equal(value_label_0, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)) + && string_is_equal(value_label_1, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))))) goto push_dropdown_list; /* > Update value and return */ diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index ee52bbac5b..c1d0f9f4c2 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -439,7 +439,8 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_meta_overlay_next, ME DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_hotkey_block_delay, MENU_ENUM_SUBLABEL_INPUT_HOTKEY_BLOCK_DELAY) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_input_adc_type, MENU_ENUM_SUBLABEL_INPUT_ADC_TYPE) #ifdef HAVE_MATERIALUI -DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_materialui_icons_enable, MENU_ENUM_SUBLABEL_MATERIALUI_ICONS_ENABLE) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_materialui_icons_enable, MENU_ENUM_SUBLABEL_MATERIALUI_ICONS_ENABLE) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_materialui_switch_icons, MENU_ENUM_SUBLABEL_MATERIALUI_SWITCH_ICONS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_materialui_playlist_icons_enable, MENU_ENUM_SUBLABEL_MATERIALUI_PLAYLIST_ICONS_ENABLE) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_materialui_landscape_layout_optimization, MENU_ENUM_SUBLABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_materialui_show_nav_bar, MENU_ENUM_SUBLABEL_MATERIALUI_SHOW_NAV_BAR) @@ -904,6 +905,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_throttle_framerate, #ifdef HAVE_XMB DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_layout, MENU_ENUM_SUBLABEL_XMB_LAYOUT) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_icon_theme, MENU_ENUM_SUBLABEL_XMB_THEME) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_switch_icons, MENU_ENUM_SUBLABEL_XMB_SWITCH_ICONS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_shadows_enable, MENU_ENUM_SUBLABEL_XMB_SHADOWS_ENABLE) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_vertical_thumbnails, MENU_ENUM_SUBLABEL_XMB_VERTICAL_THUMBNAILS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_xmb_thumbnail_scale_factor, MENU_ENUM_SUBLABEL_MENU_XMB_THUMBNAIL_SCALE_FACTOR) @@ -2320,6 +2322,11 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE: #ifdef HAVE_MATERIALUI BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_icons_enable); +#endif + break; + case MENU_ENUM_LABEL_MATERIALUI_SWITCH_ICONS: +#ifdef HAVE_MATERIALUI + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_switch_icons); #endif break; case MENU_ENUM_LABEL_MATERIALUI_PLAYLIST_ICONS_ENABLE: @@ -2999,6 +3006,11 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_XMB_THEME: #ifdef HAVE_XMB BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_xmb_icon_theme); +#endif + break; + case MENU_ENUM_LABEL_XMB_SWITCH_ICONS: +#ifdef HAVE_XMB + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_xmb_switch_icons); #endif break; case MENU_ENUM_LABEL_MENU_THROTTLE_FRAMERATE: diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index c8279f5a95..92881aa7a0 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -3847,31 +3847,40 @@ static void materialui_render(void *data, /* Utility functions */ -enum materialui_entry_value_type materialui_get_entry_value_type( +static enum materialui_entry_value_type materialui_get_entry_value_type( materialui_handle_t *mui, const char *entry_value, bool entry_checked, - unsigned entry_type, enum msg_file_type entry_file_type) + unsigned entry_type, enum msg_file_type entry_file_type, + uint8_t entry_setting_type) { enum materialui_entry_value_type value_type = MUI_ENTRY_VALUE_NONE; /* Check entry value string */ if (!string_is_empty(entry_value)) { + settings_t *settings = config_get_ptr(); + bool menu_switch_icons = settings->bools.menu_materialui_switch_icons; + /* Toggle switch off */ - if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_DISABLED)) || - string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))) + if (menu_switch_icons && entry_setting_type == ST_BOOL) { - if (mui->textures.list[MUI_TEXTURE_SWITCH_OFF]) - value_type = MUI_ENTRY_VALUE_SWITCH_OFF; - else - value_type = MUI_ENTRY_VALUE_TEXT; - } - /* Toggle switch on */ - else if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_ENABLED)) || - string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))) - { - if (mui->textures.list[MUI_TEXTURE_SWITCH_ON]) - value_type = MUI_ENTRY_VALUE_SWITCH_ON; + if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_DISABLED)) || + string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))) + { + if (mui->textures.list[MUI_TEXTURE_SWITCH_OFF]) + value_type = MUI_ENTRY_VALUE_SWITCH_OFF; + else + value_type = MUI_ENTRY_VALUE_TEXT; + } + /* Toggle switch on */ + else if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_ENABLED)) || + string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))) + { + if (mui->textures.list[MUI_TEXTURE_SWITCH_ON]) + value_type = MUI_ENTRY_VALUE_SWITCH_ON; + else + value_type = MUI_ENTRY_VALUE_TEXT; + } else value_type = MUI_ENTRY_VALUE_TEXT; } @@ -4036,7 +4045,7 @@ static void materialui_render_menu_entry_default( msg_hash_calculate(entry_value)); entry_value_type = materialui_get_entry_value_type( mui, entry_value, entry->flags & MENU_ENTRY_FLAG_CHECKED, - entry_type, entry_file_type); + entry_type, entry_file_type, entry->setting_type); /* Draw entry icon * > Has to be done first, since it affects the left @@ -4273,7 +4282,9 @@ static void materialui_render_menu_entry_default( entry_value_color = (entry_selected || touch_feedback_active) ? mui->colors.list_text_highlighted : mui->colors.list_text; - if (string_is_equal(value_buf, "null")) + /* Muted/disabled color for disabled values */ + if ( string_is_equal(value_buf, "null") + || string_is_equal(value_buf, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))) entry_value_color = mui->colors.disabled_text; /* Draw value string */ @@ -9852,7 +9863,7 @@ static int materialui_pointer_up_swipe_horz_default( msg_hash_calculate(entry_value)); entry_value_type = materialui_get_entry_value_type( mui, entry_value, last_entry.flags & MENU_ENTRY_FLAG_CHECKED, - entry_type, entry_file_type); + entry_type, entry_file_type, entry->setting_type); /* If entry has a 'settings' type, reset scroll position */ if ((entry_value_type == MUI_ENTRY_VALUE_TEXT) || diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 010e283ebb..218eb6d6fe 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -4888,12 +4888,13 @@ static void rgui_render_toggle_switch( static enum rgui_entry_value_type rgui_get_entry_value_type( const char *entry_value, + uint8_t entry_setting_type, bool entry_checked, bool switch_icons_enabled) { if (!string_is_empty(entry_value)) { - if (switch_icons_enabled) + if (switch_icons_enabled && entry_setting_type == ST_BOOL) { /* Toggle switch off */ if (string_is_equal(entry_value, msg_hash_to_str(MENU_ENUM_LABEL_DISABLED)) || @@ -5500,6 +5501,7 @@ static void rgui_render( /* Get 'type' of entry value component */ entry_value_type = rgui_get_entry_value_type( entry_value, + entry.setting_type, entry.flags & MENU_ENTRY_FLAG_CHECKED, rgui_switch_icons); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index f6a3485e06..53bf609bdb 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -3607,6 +3607,7 @@ static int xmb_draw_item( settings->uints.menu_xmb_thumbnail_scale_factor; bool menu_xmb_vertical_thumbnails = settings->bools.menu_xmb_vertical_thumbnails; bool menu_show_sublabels = settings->bools.menu_show_sublabels; + bool menu_switch_icons = settings->bools.menu_xmb_switch_icons; unsigned show_history_icons = settings->uints.playlist_show_history_icons; unsigned menu_xmb_vertical_fade_factor = settings->uints.menu_xmb_vertical_fade_factor; @@ -3669,19 +3670,25 @@ static int xmb_draw_item( strlcpy(entry.path, entry_path, sizeof(entry.path)); } - if ( string_is_equal(entry.value, msg_hash_to_str(MENU_ENUM_LABEL_DISABLED)) - || string_is_equal(entry.value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))) + /* Only show switch icons with bool type options */ + if (menu_switch_icons && entry.setting_type == ST_BOOL) { - if (xmb->textures.list[XMB_TEXTURE_SWITCH_OFF]) - texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_OFF]; - else - do_draw_text = true; - } - else if (string_is_equal(entry.value, msg_hash_to_str(MENU_ENUM_LABEL_ENABLED)) - || string_is_equal(entry.value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))) - { - if (xmb->textures.list[XMB_TEXTURE_SWITCH_ON]) - texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_ON]; + if ( string_is_equal(entry.value, msg_hash_to_str(MENU_ENUM_LABEL_DISABLED)) + || string_is_equal(entry.value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))) + { + if (xmb->textures.list[XMB_TEXTURE_SWITCH_OFF]) + texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_OFF]; + else + do_draw_text = true; + } + else if (string_is_equal(entry.value, msg_hash_to_str(MENU_ENUM_LABEL_ENABLED)) + || string_is_equal(entry.value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ON))) + { + if (xmb->textures.list[XMB_TEXTURE_SWITCH_ON]) + texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_ON]; + else + do_draw_text = true; + } else do_draw_text = true; } diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 05824bfe42..8965f3a626 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -10189,6 +10189,7 @@ unsigned menu_displaylist_build_list( {MENU_ENUM_LABEL_MENU_FONT_COLOR_BLUE, PARSE_ONLY_UINT, true}, {MENU_ENUM_LABEL_XMB_LAYOUT, PARSE_ONLY_UINT, true}, {MENU_ENUM_LABEL_XMB_THEME, PARSE_ONLY_UINT, true}, + {MENU_ENUM_LABEL_XMB_SWITCH_ICONS, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_XMB_SHADOWS_ENABLE, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_XMB_RIBBON_ENABLE, PARSE_ONLY_UINT, true}, {MENU_ENUM_LABEL_XMB_MENU_COLOR_THEME, PARSE_ONLY_UINT, true}, @@ -10196,6 +10197,7 @@ unsigned menu_displaylist_build_list( {MENU_ENUM_LABEL_OZONE_TRUNCATE_PLAYLIST_NAME, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_OZONE_SORT_AFTER_TRUNCATE_PLAYLIST_NAME, PARSE_ONLY_BOOL, false}, {MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE, PARSE_ONLY_BOOL, true}, + {MENU_ENUM_LABEL_MATERIALUI_SWITCH_ICONS, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_MATERIALUI_PLAYLIST_ICONS_ENABLE, PARSE_ONLY_BOOL, false}, {MENU_ENUM_LABEL_MATERIALUI_LANDSCAPE_LAYOUT_OPTIMIZATION, PARSE_ONLY_UINT, true}, {MENU_ENUM_LABEL_MATERIALUI_SHOW_NAV_BAR, PARSE_ONLY_BOOL, true}, diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 006aded17d..c3283cc0cc 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -379,6 +379,7 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx, entry_label = list->list[i].label; entry->type = list->list[i].type; entry->entry_idx = list->list[i].entry_idx; + entry->setting_type = 0; cbs = (menu_file_list_cbs_t*)list->list[i].actiondata; entry->idx = (unsigned)i; @@ -393,6 +394,10 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx, file_list_t *menu_stack = MENU_LIST_GET(menu_st->entries.list, 0); entry->enum_idx = cbs->enum_idx; + + if (cbs->setting && cbs->setting->type) + entry->setting_type = cbs->setting->type; + if (cbs->checked) entry->flags |= MENU_ENTRY_FLAG_CHECKED; @@ -462,6 +467,20 @@ void menu_entry_get(menu_entry_t *entry, size_t stack_idx, } } + /* Inspect core options and set entries with only 2 options as + * boolean for accurate graphical switch icons */ + if (entry->type >= MENU_SETTINGS_CORE_OPTION_START) + { + struct core_option *option = NULL; + core_option_manager_t *coreopts = NULL; + size_t option_index = entry->type - MENU_SETTINGS_CORE_OPTION_START; + retroarch_ctl(RARCH_CTL_CORE_OPTIONS_LIST_GET, &coreopts); + option = (struct core_option*)&coreopts->opts[option_index]; + + if (option->vals->size == 2) + entry->setting_type = ST_BOOL; + } + if (path_enabled) { if (!string_is_empty(path) && !use_representation) diff --git a/menu/menu_entries.h b/menu/menu_entries.h index b1d6d6d575..6d1b2c6073 100644 --- a/menu/menu_entries.h +++ b/menu/menu_entries.h @@ -154,6 +154,7 @@ typedef struct menu_entry unsigned type; unsigned spacing; enum msg_hash_enums enum_idx; + uint8_t setting_type; uint8_t flags; char path[255]; char label[255]; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 717124fc3a..fc52a643e4 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -16831,6 +16831,21 @@ static bool setting_append_list( MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_REINIT); (*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_COMBOBOX; + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_xmb_switch_icons, + MENU_ENUM_LABEL_XMB_SWITCH_ICONS, + MENU_ENUM_LABEL_VALUE_XMB_SWITCH_ICONS, + DEFAULT_XMB_SWITCH_ICONS, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + CONFIG_BOOL( list, list_info, &settings->bools.menu_xmb_shadows_enable, @@ -17424,6 +17439,21 @@ static bool setting_append_list( (*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_BOOL( + list, list_info, + &settings->bools.menu_materialui_switch_icons, + MENU_ENUM_LABEL_MATERIALUI_SWITCH_ICONS, + MENU_ENUM_LABEL_VALUE_MATERIALUI_SWITCH_ICONS, + DEFAULT_MATERIALUI_SWITCH_ICONS, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + CONFIG_BOOL( list, list_info, &settings->bools.menu_materialui_playlist_icons_enable, diff --git a/msg_hash.h b/msg_hash.h index 21c9fd505f..d7e441164d 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -621,6 +621,7 @@ enum msg_hash_enums MENU_ENUM_LABEL_VALUE_AUTO, MENU_LABEL(MATERIALUI_ICONS_ENABLE), + MENU_LABEL(MATERIALUI_SWITCH_ICONS), MENU_LABEL(MATERIALUI_PLAYLIST_ICONS_ENABLE), MENU_LABEL(MATERIALUI_SHOW_NAV_BAR), MENU_LABEL(MATERIALUI_AUTO_ROTATE_NAV_BAR), @@ -1327,6 +1328,7 @@ enum msg_hash_enums MENU_LABEL(XMB_FONT), MENU_LABEL(XMB_LAYOUT), MENU_LABEL(XMB_THEME), + MENU_LABEL(XMB_SWITCH_ICONS), MENU_LABEL(XMB_MAIN_MENU_ENABLE_SETTINGS), MENU_LABEL(XMB_SHADOWS_ENABLE), MENU_LABEL(CONTENT_SHOW_REWIND),