glui: Honor menu_show_sublabels option (#16878)

This commit is contained in:
Eric Warmenhoven 2024-08-15 18:27:17 -04:00 committed by GitHub
parent 079ef42a40
commit 5b04c060e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -2754,6 +2754,7 @@ static uint8_t materialui_count_sublabel_lines(
menu_entry_t entry;
char wrapped_sublabel_str[MENU_SUBLABEL_MAX_LENGTH];
int sublabel_width_max = 0;
settings_t *settings = config_get_ptr();
wrapped_sublabel_str[0] = '\0';
@ -2764,7 +2765,7 @@ static uint8_t materialui_count_sublabel_lines(
menu_entry_get(&entry, 0, entry_idx, NULL, true);
/* If sublabel is empty, return immediately */
if (string_is_empty(entry.sublabel))
if (!settings->bools.menu_show_sublabels || string_is_empty(entry.sublabel))
return 0;
/* Wrap sublabel string to fit available width */
@ -4014,6 +4015,7 @@ static void materialui_render_menu_entry_default(
bool draw_text_outside = (x_offset != 0);
gfx_display_t *p_disp = disp_get_ptr();
uico_driver_state_t *uico_st = uico_state_get_ptr();
settings_t *settings = config_get_ptr();
static float color_white[16] = {
1.0f, 1.0f, 1.0f, 1.0f,
@ -4190,7 +4192,7 @@ static void materialui_render_menu_entry_default(
/* Draw entry sublabel
* > Must be done before label + value, since it
* affects y offset positions */
if (!string_is_empty(entry->sublabel))
if (settings->bools.menu_show_sublabels && !string_is_empty(entry->sublabel))
{
/* Note: Due to the way the selection highlight
* marker is drawn (height is effectively 1px larger
@ -4550,7 +4552,7 @@ static void materialui_render_menu_entry_playlist_list(
/* Draw entry sublabel
* > Must be done before label, since it
* affects y offset positions */
if (!string_is_empty(entry->sublabel))
if (settings->bools.menu_show_sublabels && !string_is_empty(entry->sublabel))
{
/* Note: Due to the way the selection highlight
* marker is drawn (height is effectively 1px larger

View file

@ -20130,6 +20130,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_BOOL(
list, list_info,