diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c index deb71b11..63d38ab2 100644 --- a/src/fe-common/core/themes.c +++ b/src/fe-common/core/themes.c @@ -678,7 +678,8 @@ static void theme_read(THEME_REC *theme, const char *path, const char *data) config = config_open(path, -1); if (config == NULL) { /* didn't exist or no access? */ - theme->default_color = 15; + theme->default_color = 0; + theme->default_bold_color = 7; return; } config_parse(config); @@ -706,7 +707,10 @@ static void theme_read(THEME_REC *theme, const char *path, const char *data) } } - theme->default_color = config_get_int(config, NULL, "default_color", 15); + theme->default_color = + config_get_int(config, NULL, "default_color", 0); + theme->default_bold_color = + config_get_int(config, NULL, "default_bold_color", 7); theme_read_replaces(config, theme); theme_read_abstracts(config, theme); @@ -1034,7 +1038,8 @@ static void themes_read(void) fname = g_strdup_printf("%s/.irssi/default.theme", g_get_home_dir()); current_theme = theme_create(fname, "default"); - current_theme->default_color = 15; + current_theme->default_color = 0; + current_theme->default_bold_color = 7; theme_read(current_theme, NULL, default_theme); g_free(fname); } diff --git a/src/fe-common/core/themes.h b/src/fe-common/core/themes.h index cfca4c0d..c5be2400 100644 --- a/src/fe-common/core/themes.h +++ b/src/fe-common/core/themes.h @@ -14,7 +14,7 @@ typedef struct { char *path; char *name; - int default_color; + int default_color, default_bold_color; GHashTable *modules; GSList *replace_keys; diff --git a/src/fe-text/gui-printtext.c b/src/fe-text/gui-printtext.c index ea1b64f2..89359208 100644 --- a/src/fe-text/gui-printtext.c +++ b/src/fe-text/gui-printtext.c @@ -266,12 +266,12 @@ static void get_colors(int flags, int *fg, int *bg) /* mirc colors - real range is 0..15, but after 16 colors wrap to 0, 1, ... */ *fg = *fg < 0 ? - /*current_theme->default_color*/0 : mirc_colors[*fg % 16]; + current_theme->default_color : mirc_colors[*fg % 16]; *bg = *bg < 0 ? 0 : mirc_colors[*bg % 16]; } else { /* default colors */ *fg = *fg < 0 || *fg > 15 ? - /*current_theme->default_color*/0 : *fg; + current_theme->default_color : *fg; *bg = *bg < 0 || *bg > 15 ? 0 : *bg; if (*fg > 8) *fg -= 8; @@ -285,7 +285,7 @@ static void get_colors(int flags, int *fg, int *bg) if (*fg == 8) *fg |= ATTR_COLOR8; if (flags & PRINTFLAG_BOLD) { - if (*fg == 0) *fg = current_theme->default_color; + if (*fg == 0) *fg = current_theme->default_bold_color; *fg |= 8; } if (flags & PRINTFLAG_UNDERLINE) *fg |= ATTR_UNDERLINE; diff --git a/src/fe-text/screen.c b/src/fe-text/screen.c index d38ab88f..65f30bf9 100644 --- a/src/fe-text/screen.c +++ b/src/fe-text/screen.c @@ -213,11 +213,12 @@ void set_color(WINDOW *window, int col) if (!use_colors) attr = (col & 0x70) ? A_REVERSE : 0; - else { - attr = (col & ATTR_COLOR8) ? - (A_DIM | COLOR_PAIR(63)) : - (COLOR_PAIR((col&7) + (col&0x70)/2)); - } + else if (col & ATTR_COLOR8) + attr = (A_DIM | COLOR_PAIR(63)); + else if ((col & 0x77) == 0) + attr = A_NORMAL; + else + attr = (COLOR_PAIR((col&7) + (col&0x70)/2)); if (col & 0x08) attr |= A_BOLD; if (col & 0x80) attr |= A_BLINK;