Merge pull request #12382 from Ryunam/ozone-themes-id

Minor updates to Ozone themes code
This commit is contained in:
Autechre 2021-05-12 09:18:02 +02:00 committed by GitHub
commit a6d92de0b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 13 deletions

View File

@ -355,6 +355,19 @@ enum rgui_particle_animation_effect
RGUI_PARTICLE_EFFECT_LAST RGUI_PARTICLE_EFFECT_LAST
}; };
enum ozone_color_theme
{
OZONE_COLOR_THEME_BASIC_WHITE = 0,
OZONE_COLOR_THEME_BASIC_BLACK,
OZONE_COLOR_THEME_NORD,
OZONE_COLOR_THEME_GRUVBOX_DARK,
OZONE_COLOR_THEME_BOYSENBERRY,
OZONE_COLOR_THEME_HACKING_THE_KERNEL,
OZONE_COLOR_THEME_TWILIGHT_ZONE,
OZONE_COLOR_THEME_DRACULA,
OZONE_COLOR_THEME_LAST
};
enum menu_action enum menu_action
{ {
MENU_ACTION_NOOP = 0, MENU_ACTION_NOOP = 0,

View File

@ -4628,51 +4628,47 @@ static void setting_get_string_representation_uint_ozone_menu_color_theme(
char *s, size_t len) char *s, size_t len)
{ {
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
bool menu_preferred_system_color_theme_set = settings->bools.menu_preferred_system_color_theme_set;
if (!setting) if (!setting)
return; return;
if (menu_preferred_system_color_theme_set)
strlcpy(s, "System default", len);
switch (*setting->value.target.unsigned_integer) switch (*setting->value.target.unsigned_integer)
{ {
case 1: case OZONE_COLOR_THEME_BASIC_BLACK:
strlcpy(s, strlcpy(s,
msg_hash_to_str( msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_BASIC_BLACK), len); MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_BASIC_BLACK), len);
break; break;
case 2: case OZONE_COLOR_THEME_NORD:
strlcpy(s, strlcpy(s,
msg_hash_to_str( msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_NORD), len); MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_NORD), len);
break; break;
case 3: case OZONE_COLOR_THEME_GRUVBOX_DARK:
strlcpy(s, strlcpy(s,
msg_hash_to_str( msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_GRUVBOX_DARK), len); MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_GRUVBOX_DARK), len);
break; break;
case 4: case OZONE_COLOR_THEME_BOYSENBERRY:
strlcpy(s, strlcpy(s,
msg_hash_to_str( msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_BOYSENBERRY), len); MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_BOYSENBERRY), len);
break; break;
case 5: case OZONE_COLOR_THEME_HACKING_THE_KERNEL:
strlcpy(s, strlcpy(s,
msg_hash_to_str( msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_HACKING_THE_KERNEL), len); MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_HACKING_THE_KERNEL), len);
break; break;
case 6: case OZONE_COLOR_THEME_TWILIGHT_ZONE:
strlcpy(s, strlcpy(s,
msg_hash_to_str( msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_TWILIGHT_ZONE), len); MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_TWILIGHT_ZONE), len);
break; break;
case 7: case OZONE_COLOR_THEME_DRACULA:
strlcpy(s, strlcpy(s,
msg_hash_to_str( msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_DRACULA), len); MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_DRACULA), len);
break; break;
case 0: case OZONE_COLOR_THEME_BASIC_WHITE:
default: default:
strlcpy(s, strlcpy(s,
msg_hash_to_str( msg_hash_to_str(
@ -15913,7 +15909,7 @@ static bool setting_append_list(
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint; (*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].get_string_representation = (*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_uint_ozone_menu_color_theme; &setting_get_string_representation_uint_ozone_menu_color_theme;
menu_settings_list_current_add_range(list, list_info, 0, 7, 1, true, true); menu_settings_list_current_add_range(list, list_info, 0, OZONE_COLOR_THEME_LAST-1, 1, true, true);
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_COMBOBOX; (*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_COMBOBOX;
CONFIG_BOOL( CONFIG_BOOL(