[theme] default to using default colors and, if default coloring is not enabled, turn -1 into white/black for fg/bg

This commit is contained in:
Timothy Stack 2019-10-23 06:09:47 -07:00
parent 2ed88815da
commit 9db2dfa7a4
2 changed files with 8 additions and 1 deletions

View File

@ -107,7 +107,7 @@ struct key_map {
struct _lnav_config {
std::string lc_ui_clock_format;
bool lc_ui_dim_text;
bool lc_ui_default_colors;
bool lc_ui_default_colors{true};
std::string lc_ui_keymap;
std::string lc_ui_theme;
std::unordered_map<std::string, key_map> lc_ui_keymaps;

View File

@ -619,6 +619,13 @@ inline attr_t attr_for_colors(int &pair_base, short fg, short bg)
if (bg == COLOR_BLACK) {
bg = -1;
}
} else {
if (fg == -1) {
fg = COLOR_WHITE;
}
if (bg == -1) {
bg = COLOR_BLACK;
}
}
}