Add separate visibility toggle for playlist tabs (#17545)

This commit is contained in:
sonninnos 2025-02-10 01:45:50 +02:00 committed by GitHub
parent ad72af9d40
commit 372396d5b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 47 additions and 9 deletions

View File

@ -811,6 +811,7 @@
#define DEFAULT_MENU_CONTENT_SHOW_ADD_ENTRY MENU_ADD_CONTENT_ENTRY_DISPLAY_MAIN_TAB
#define DEFAULT_CONTENT_SHOW_PLAYLISTS true
#define DEFAULT_CONTENT_SHOW_PLAYLIST_TABS true
#if defined(HAVE_LIBRETRODB)
#define DEFAULT_MENU_CONTENT_SHOW_EXPLORE true

View File

@ -2011,6 +2011,7 @@ static struct config_bool_setting *populate_settings_bool(
#endif
SETTING_BOOL("content_show_history", &settings->bools.menu_content_show_history, true, DEFAULT_CONTENT_SHOW_HISTORY, false);
SETTING_BOOL("content_show_playlists", &settings->bools.menu_content_show_playlists, true, DEFAULT_CONTENT_SHOW_PLAYLISTS, false);
SETTING_BOOL("content_show_playlist_tabs", &settings->bools.menu_content_show_playlist_tabs, true, DEFAULT_CONTENT_SHOW_PLAYLIST_TABS, false);
#if defined(HAVE_LIBRETRODB)
SETTING_BOOL("content_show_explore", &settings->bools.menu_content_show_explore, true, DEFAULT_MENU_CONTENT_SHOW_EXPLORE, false);
#endif

View File

@ -824,6 +824,7 @@ typedef struct settings
bool menu_content_show_history;
bool menu_content_show_add;
bool menu_content_show_playlists;
bool menu_content_show_playlist_tabs;
bool menu_content_show_explore;
bool menu_use_preferred_system_color_theme;
bool menu_preferred_system_color_theme_set;

View File

@ -6585,7 +6585,15 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CONTENT_SHOW_PLAYLISTS,
"Show the playlists. (Restart required on Ozone/XMB)"
"Show the playlists in Main Menu. Ignored in GLUI if playlist tabs and navbar are enabled."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_PLAYLIST_TABS,
"Show Playlist Tabs"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CONTENT_SHOW_PLAYLIST_TABS,
"Show the playlist tabs. Does not affect RGUI. Navbar must be enabled in GLUI. (Restart required on Ozone/XMB)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_EXPLORE,

View File

@ -1189,7 +1189,8 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_settings_tab_enable_password,
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_history_tab, MENU_ENUM_SUBLABEL_CONTENT_SHOW_HISTORY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_import_content_tab, MENU_ENUM_SUBLABEL_CONTENT_SHOW_ADD)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_import_content_entry, MENU_ENUM_SUBLABEL_CONTENT_SHOW_ADD_ENTRY)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_playlist_tabs, MENU_ENUM_SUBLABEL_CONTENT_SHOW_PLAYLISTS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_playlists_tab, MENU_ENUM_SUBLABEL_CONTENT_SHOW_PLAYLISTS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_playlist_tabs, MENU_ENUM_SUBLABEL_CONTENT_SHOW_PLAYLIST_TABS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_explore_tab, MENU_ENUM_SUBLABEL_CONTENT_SHOW_EXPLORE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_contentless_cores_tab, MENU_ENUM_SUBLABEL_CONTENT_SHOW_CONTENTLESS_CORES)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_main_menu_enable_settings, MENU_ENUM_SUBLABEL_XMB_MAIN_MENU_ENABLE_SETTINGS)
@ -2823,6 +2824,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_import_content_entry);
break;
case MENU_ENUM_LABEL_CONTENT_SHOW_PLAYLISTS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_playlists_tab);
break;
case MENU_ENUM_LABEL_CONTENT_SHOW_PLAYLIST_TABS:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_playlist_tabs);
break;
case MENU_ENUM_LABEL_CONTENT_SHOW_EXPLORE:

View File

@ -8466,7 +8466,7 @@ static void materialui_populate_nav_bar(materialui_handle_t *mui,
{
size_t menu_tab_index = 0;
bool menu_content_show_playlists =
settings->bools.menu_content_show_playlists;
settings->bools.menu_content_show_playlist_tabs;
/* Cache last active menu tab index */
mui->nav_bar.last_active_menu_tab_index = mui->nav_bar.active_menu_tab_index;

View File

@ -4864,7 +4864,7 @@ static void ozone_init_horizontal_list(ozone_handle_t *ozone, settings_t *settin
size_t i, list_size;
menu_displaylist_info_t info;
const char *dir_playlist = settings->paths.directory_playlist;
bool menu_content_show_playlists = settings->bools.menu_content_show_playlists;
bool menu_content_show_playlists = settings->bools.menu_content_show_playlist_tabs;
bool ozone_truncate_playlist_name = settings->bools.ozone_truncate_playlist_name;
bool ozone_sort_after_truncate = settings->bools.ozone_sort_after_truncate_playlist_name;
@ -5943,8 +5943,9 @@ border_iterate:
else if (ozone->depth == 2 && entry.type == FILE_TYPE_PLAYLIST_COLLECTION)
{
ozone_node_t *sidebar_node = (ozone_node_t*)
file_list_get_userdata_at_offset(&ozone->horizontal_list,
selection_buf->list[i].entry_idx);
(ozone->horizontal_list.size)
? file_list_get_userdata_at_offset(&ozone->horizontal_list, selection_buf->list[i].entry_idx)
: NULL;
if (sidebar_node && sidebar_node->icon)
texture = sidebar_node->icon;

View File

@ -2591,7 +2591,7 @@ static void xmb_init_horizontal_list(xmb_handle_t *xmb)
menu_displaylist_info_t info;
settings_t *settings = config_get_ptr();
const char *dir_playlist = settings->paths.directory_playlist;
bool menu_content_show_playlists = settings->bools.menu_content_show_playlists;
bool menu_content_show_playlists = settings->bools.menu_content_show_playlist_tabs;
bool truncate_playlist_name = settings->bools.ozone_truncate_playlist_name;
bool sort_after_truncate = settings->bools.ozone_sort_after_truncate_playlist_name;
@ -5045,7 +5045,11 @@ static int xmb_draw_item(
/* "Main Menu" playlists */
else if (xmb->depth == 2 && entry_type == FILE_TYPE_PLAYLIST_COLLECTION)
{
xmb_node_t *sidebar_node = (xmb_node_t*) file_list_get_userdata_at_offset(&xmb->horizontal_list, list->list[i].entry_idx);
xmb_node_t *sidebar_node = (xmb_node_t*)
(xmb->horizontal_list.size)
? file_list_get_userdata_at_offset(&xmb->horizontal_list, list->list[i].entry_idx)
: NULL;
if (sidebar_node && sidebar_node->icon)
texture = sidebar_node->icon;
}

View File

@ -10015,6 +10015,7 @@ unsigned menu_displaylist_build_list(
#endif
{MENU_ENUM_LABEL_CONTENT_SHOW_ADD_ENTRY, PARSE_ONLY_UINT, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_PLAYLISTS, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_PLAYLIST_TABS, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_HISTORY, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_FAVORITES, PARSE_ONLY_BOOL, true },
{MENU_ENUM_LABEL_CONTENT_SHOW_IMAGES, PARSE_ONLY_BOOL, true },
@ -14913,7 +14914,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
&& !settings->bools.menu_materialui_show_nav_bar));
if ( string_is_equal(menu_ident, "glui")
&& settings->bools.menu_materialui_show_nav_bar)
&& settings->bools.menu_materialui_show_nav_bar
&& settings->bools.menu_content_show_playlist_tabs)
show_playlists = false;
if (flags & RUNLOOP_FLAG_CORE_RUNNING)

View File

@ -19657,6 +19657,21 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
CONFIG_BOOL(
list, list_info,
&settings->bools.menu_content_show_playlist_tabs,
MENU_ENUM_LABEL_CONTENT_SHOW_PLAYLIST_TABS,
MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_PLAYLIST_TABS,
DEFAULT_CONTENT_SHOW_PLAYLIST_TABS,
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);
#if defined(HAVE_LIBRETRODB)
CONFIG_BOOL(
list, list_info,

View File

@ -1622,6 +1622,7 @@ enum msg_hash_enums
MENU_LABEL(CONTENT_SHOW_ADD), /* Deprecated */
MENU_LABEL(CONTENT_SHOW_ADD_ENTRY),
MENU_LABEL(CONTENT_SHOW_PLAYLISTS),
MENU_LABEL(CONTENT_SHOW_PLAYLIST_TABS),
MENU_LABEL(CONTENT_SHOW_EXPLORE),
MENU_LABEL(CONTENT_SHOW_CONTENTLESS_CORES),
MENU_ENUM_LABEL_VALUE_SHOW_CONTENTLESS_CORES_ALL,