summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-config.c8
-rw-r--r--src/core/wee-config.h1
-rw-r--r--src/gui/curses/gui-curses-color.c69
-rw-r--r--src/gui/curses/gui-curses.h2
4 files changed, 60 insertions, 20 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 588aeaea2..db32bdbe4 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -85,6 +85,7 @@ struct t_config_option *config_look_bar_more_up;
struct t_config_option *config_look_bar_more_down;
struct t_config_option *config_look_buffer_notify_default;
struct t_config_option *config_look_buffer_time_format;
+struct t_config_option *config_look_color_basic_force_bold;
struct t_config_option *config_look_color_inactive_window;
struct t_config_option *config_look_color_inactive_buffer;
struct t_config_option *config_look_color_inactive_time;
@@ -1653,6 +1654,13 @@ config_weechat_init_options ()
"\"${color}\", for example french time: "
"\"${lightblue}%H${white}%M${lightred}%S\""),
NULL, 0, 0, "%H:%M:%S", NULL, 0, NULL, NULL, &config_change_buffer_time_format, NULL, NULL, NULL);
+ config_look_color_basic_force_bold = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "color_basic_force_bold", "boolean",
+ N_("force \"bold\" attribute for light colors and \"darkgray\" in "
+ "basic colors; off by default: \"bold\" is used only if terminal "
+ "has less than 16 colors"),
+ NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_color, NULL, NULL, NULL);
config_look_color_inactive_window = config_file_new_option (
weechat_config_file, ptr_section,
"color_inactive_window", "boolean",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 07c0443e9..85245c638 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -112,6 +112,7 @@ extern struct t_config_option *config_look_buffer_notify_default;
extern struct t_config_option *config_look_buffer_time_format;
extern struct t_config_option *config_look_command_chars;
extern struct t_config_option *config_look_confirm_quit;
+extern struct t_config_option *config_look_color_basic_force_bold;
extern struct t_config_option *config_look_color_inactive_window;
extern struct t_config_option *config_look_color_inactive_buffer;
extern struct t_config_option *config_look_color_inactive_time;
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c
index 027910fc7..7ec534591 100644
--- a/src/gui/curses/gui-curses-color.c
+++ b/src/gui/curses/gui-curses-color.c
@@ -47,26 +47,47 @@
#define GUI_COLOR_TIMER_TERM_COLORS 10
-struct t_gui_color gui_weechat_colors[GUI_CURSES_NUM_WEECHAT_COLORS + 1] =
-{ { -1, -1, 0, "default" },
- { COLOR_BLACK, COLOR_BLACK, 0, "black" },
- { COLOR_BLACK, COLOR_BLACK + 8, A_BOLD, "darkgray" },
- { COLOR_RED, COLOR_RED, 0, "red" },
- { COLOR_RED, COLOR_RED + 8, A_BOLD, "lightred" },
- { COLOR_GREEN, COLOR_GREEN, 0, "green" },
- { COLOR_GREEN, COLOR_GREEN + 8, A_BOLD, "lightgreen" },
- { COLOR_YELLOW, COLOR_YELLOW, 0, "brown" },
- { COLOR_YELLOW, COLOR_YELLOW + 8, A_BOLD, "yellow" },
- { COLOR_BLUE, COLOR_BLUE, 0, "blue" },
- { COLOR_BLUE, COLOR_BLUE + 8, A_BOLD, "lightblue" },
- { COLOR_MAGENTA, COLOR_MAGENTA, 0, "magenta" },
- { COLOR_MAGENTA, COLOR_MAGENTA + 8, A_BOLD, "lightmagenta" },
- { COLOR_CYAN, COLOR_CYAN, 0, "cyan" },
- { COLOR_CYAN, COLOR_CYAN + 8, A_BOLD, "lightcyan" },
- { COLOR_WHITE, COLOR_WHITE, 0, "gray" },
- { COLOR_WHITE, COLOR_WHITE + 8, A_BOLD, "white" },
- { 0, 0, 0, NULL }
+struct t_gui_color gui_weechat_colors_bold[GUI_CURSES_NUM_WEECHAT_COLORS + 1] =
+{ { -1, -1, 0, "default" },
+ { COLOR_BLACK, COLOR_BLACK, 0, "black" },
+ { COLOR_BLACK, COLOR_BLACK + 8, A_BOLD, "darkgray" },
+ { COLOR_RED, COLOR_RED, 0, "red" },
+ { COLOR_RED, COLOR_RED + 8, A_BOLD, "lightred" },
+ { COLOR_GREEN, COLOR_GREEN, 0, "green" },
+ { COLOR_GREEN, COLOR_GREEN + 8, A_BOLD, "lightgreen" },
+ { COLOR_YELLOW, COLOR_YELLOW, 0, "brown" },
+ { COLOR_YELLOW, COLOR_YELLOW + 8, A_BOLD, "yellow" },
+ { COLOR_BLUE, COLOR_BLUE, 0, "blue" },
+ { COLOR_BLUE, COLOR_BLUE + 8, A_BOLD, "lightblue" },
+ { COLOR_MAGENTA, COLOR_MAGENTA, 0, "magenta" },
+ { COLOR_MAGENTA, COLOR_MAGENTA + 8, A_BOLD, "lightmagenta" },
+ { COLOR_CYAN, COLOR_CYAN, 0, "cyan" },
+ { COLOR_CYAN, COLOR_CYAN + 8, A_BOLD, "lightcyan" },
+ { COLOR_WHITE, COLOR_WHITE, 0, "gray" },
+ { COLOR_WHITE, COLOR_WHITE + 8, A_BOLD, "white" },
+ { 0, 0, 0, NULL }
};
+struct t_gui_color gui_weechat_colors_no_bold[GUI_CURSES_NUM_WEECHAT_COLORS + 1] =
+{ { -1, -1, 0, "default" },
+ { COLOR_BLACK, COLOR_BLACK, 0, "black" },
+ { COLOR_BLACK + 8, COLOR_BLACK + 8, 0, "darkgray" },
+ { COLOR_RED, COLOR_RED, 0, "red" },
+ { COLOR_RED + 8, COLOR_RED + 8, 0, "lightred" },
+ { COLOR_GREEN, COLOR_GREEN, 0, "green" },
+ { COLOR_GREEN + 8, COLOR_GREEN + 8, 0, "lightgreen" },
+ { COLOR_YELLOW, COLOR_YELLOW, 0, "brown" },
+ { COLOR_YELLOW + 8, COLOR_YELLOW + 8, 0, "yellow" },
+ { COLOR_BLUE, COLOR_BLUE, 0, "blue" },
+ { COLOR_BLUE + 8, COLOR_BLUE + 8, 0, "lightblue" },
+ { COLOR_MAGENTA, COLOR_MAGENTA, 0, "magenta" },
+ { COLOR_MAGENTA + 8, COLOR_MAGENTA + 8, 0, "lightmagenta" },
+ { COLOR_CYAN, COLOR_CYAN, 0, "cyan" },
+ { COLOR_CYAN + 8, COLOR_CYAN + 8, 0, "lightcyan" },
+ { COLOR_WHITE, COLOR_WHITE, 0, "gray" },
+ { COLOR_WHITE + 8, COLOR_WHITE + 8, 0, "white" },
+ { 0, 0, 0, NULL }
+};
+struct t_gui_color *gui_weechat_colors = gui_weechat_colors_bold;
/* terminal colors */
int gui_color_term_has_colors = 0; /* terminal supports colors? */
@@ -1356,6 +1377,16 @@ gui_color_palette_free (struct t_gui_color_palette *color_palette)
void
gui_color_init_weechat ()
{
+ if (CONFIG_BOOLEAN(config_look_color_basic_force_bold)
+ || (gui_color_term_colors < 16))
+ {
+ gui_weechat_colors = gui_weechat_colors_bold;
+ }
+ else
+ {
+ gui_weechat_colors = gui_weechat_colors_no_bold;
+ }
+
gui_color_build (GUI_COLOR_SEPARATOR, CONFIG_COLOR(config_color_separator), CONFIG_COLOR(config_color_chat_bg));
gui_color_build (GUI_COLOR_CHAT, CONFIG_COLOR(config_color_chat), CONFIG_COLOR(config_color_chat_bg));
diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h
index 5301234bd..ddc48cede 100644
--- a/src/gui/curses/gui-curses.h
+++ b/src/gui/curses/gui-curses.h
@@ -58,7 +58,7 @@ struct t_gui_bar_window_curses_objects
};
extern int gui_term_cols, gui_term_lines;
-extern struct t_gui_color gui_weechat_colors[];
+extern struct t_gui_color *gui_weechat_colors;
extern int gui_color_term_colors;
extern int gui_color_num_pairs;
extern int gui_color_pairs_auto_reset;