diff --git a/config.c b/config.c index 2fca8bc0..6df95292 100644 --- a/config.c +++ b/config.c @@ -2420,9 +2420,9 @@ void setup_config_box(struct controlbox *b, bool midsession, ctrl_radiobuttons(s, "Indicate bolded text by changing:", 'b', 3, HELPCTX(colours_bold), conf_radiobutton_handler, I(CONF_bold_style), - "The font", I(1), - "The colour", I(2), - "Both", I(3)); + "The font", I(BOLD_STYLE_FONT), + "The colour", I(BOLD_STYLE_COLOUR), + "Both", I(BOLD_STYLE_FONT | BOLD_STYLE_COLOUR)); str = dupprintf("Adjust the precise colours %s displays", appname); s = ctrl_getset(b, "Window/Colours", "adjust", str); diff --git a/putty.h b/putty.h index 16c4d503..c6295fa1 100644 --- a/putty.h +++ b/putty.h @@ -512,6 +512,12 @@ enum { CURSOR_BLOCK, CURSOR_UNDERLINE, CURSOR_VERTICAL_LINE }; +enum { + /* these are really bit flags */ + BOLD_STYLE_FONT = 1, + BOLD_STYLE_COLOUR = 2, +}; + enum { SER_PAR_NONE, SER_PAR_ODD, SER_PAR_EVEN, SER_PAR_MARK, SER_PAR_SPACE }; diff --git a/unix/window.c b/unix/window.c index 45df2213..f8dbda74 100644 --- a/unix/window.c +++ b/unix/window.c @@ -3896,11 +3896,11 @@ static void do_text_internal( truecolour.fg = truecolour.bg; truecolour.bg = trgb; } - if ((inst->bold_style & 2) && (attr & ATTR_BOLD)) { + if ((inst->bold_style & BOLD_STYLE_COLOUR) && (attr & ATTR_BOLD)) { if (nfg < 16) nfg |= 8; else if (nfg >= 256) nfg |= 1; } - if ((inst->bold_style & 2) && (attr & ATTR_BLINK)) { + if ((inst->bold_style & BOLD_STYLE_COLOUR) && (attr & ATTR_BLINK)) { if (nbg < 16) nbg |= 8; else if (nbg >= 256) nbg |= 1; } @@ -3920,7 +3920,7 @@ static void do_text_internal( widefactor = 1; } - if ((attr & ATTR_BOLD) && (inst->bold_style & 1)) { + if ((attr & ATTR_BOLD) && (inst->bold_style & BOLD_STYLE_FONT)) { bold = true; fontid |= 1; } else { diff --git a/windows/window.c b/windows/window.c index 0d1d10d3..21170614 100644 --- a/windows/window.c +++ b/windows/window.c @@ -1402,9 +1402,11 @@ static void init_fonts(WinGuiSeat *wgs, int pick_width, int pick_height) for (i = 0; i < FONT_MAXNO; i++) wgs->fonts[i] = NULL; - wgs->bold_font_mode = conf_get_int(wgs->conf, CONF_bold_style) & 1 ? + wgs->bold_font_mode = + conf_get_int(wgs->conf, CONF_bold_style) & BOLD_STYLE_FONT ? BOLD_FONT : BOLD_NONE; - wgs->bold_colours = conf_get_int(wgs->conf, CONF_bold_style) & 2 ? + wgs->bold_colours = + conf_get_int(wgs->conf, CONF_bold_style) & BOLD_STYLE_COLOUR ? true : false; wgs->und_mode = UND_FONT;