From 4217105ff0ebaef3c11de9d4a00bef2629dfc59b Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Fri, 1 Apr 2022 17:00:13 +0300 Subject: Allow bold for default colours --- src/config/theme.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/config') diff --git a/src/config/theme.c b/src/config/theme.c index 9becc833..d7b55b0a 100644 --- a/src/config/theme.c +++ b/src/config/theme.c @@ -663,20 +663,21 @@ theme_get_bkgnd(void) static void _theme_prep_fgnd(char* setting, GString* lookup_str, gboolean* bold) { - gchar* val = g_key_file_get_string(theme, "colours", setting, NULL); - if (!val) { - char* def = g_hash_table_lookup(defaults, setting); - g_string_append(lookup_str, def); + gchar* conf_str = g_key_file_get_string(theme, "colours", setting, NULL); + gchar* val = conf_str; + + if (!val) + val = g_hash_table_lookup(defaults, setting); + + if (g_str_has_prefix(val, "bold_")) { + g_string_append(lookup_str, &val[5]); + *bold = TRUE; } else { - if (g_str_has_prefix(val, "bold_")) { - g_string_append(lookup_str, &val[5]); - *bold = TRUE; - } else { - g_string_append(lookup_str, val); - *bold = FALSE; - } + g_string_append(lookup_str, val); + *bold = FALSE; } - g_free(val); + + g_free(conf_str); } char* -- cgit 1.4.1-2-gfad0